如何解决JavaFX ScrollPane在右侧和底部留下一个像素边框
我一直在开发一个程序,其中有一个 TextArea 节点,该节点正在 AnchorPane 内移动。然而,正如标题所说,TextArea 的 ScrollPane 留下了 1 像素的透明边框。这是一个问题,因为当鼠标位于此边框内时,它会将光标从 Cursor.TEXT 更改为 Cursor.DEFAULT,并且在启动 mousepressed 事件时也不会重新定位插入符号。这是问题的简单说明: example
我发现,此边框适用于所有 Scrollpanes,而不仅仅是 TextArea 中的那些。这是我用于 ScrollPane 的 css
的样子:
.scroll-pane{
-fx-focus-color: #000000;
-fx-background-color: transparent;
}
.text-area {
-fx-wrap-text: true;
-fx-background-color: transparent;
}
.text-area .scroll-pane {
-fx-hbar-policy: never;
-fx-vbar-policy: never;
-fx-padding: 0;
-fx-background-color: transparent;
}
.text-area > .scroll-pane > .scroll-bar:horizontal {
-fx-background-radius: null;
}
.text-area > .scroll-pane > .scroll-bar:vertical {
-fx-background-radius: null;
}
.text-area > .scroll-pane > .corner {
-fx-background-radius: null;
}
.text-area .scroll-pane .viewport{
-fx-background-color: transparent;
}
.text-area .scroll-pane .content{
-fx-background-color: transparent;
}
我已经阅读了 modena.css
中 ScrollPane 的默认值,并使用了它们,但不幸的是,我的问题仍然存在。
一如既往,对此事的任何意见都非常感谢!
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。