css 的 JavaFX TextArea 样式
JavaFX TextArea style with css
我想知道如何更改出现在文本区域中的内边框颜色。我想删除文本区域红色边框内的蓝色透明边框。我检查了 modena.css 文件,但找不到解决方案。
我的 css 文件中的内容:
.text-area:focused {
-fx-background-color: white;
-fx-border-color: rgba(229,0,0,0.3);
}
TextArea 的内容有一个额外的 border/background。要 change/get 摆脱它,您需要在 css.
中添加一个样式
类似
.text-area:focused .content {
-fx-background-color: white;
}
不确定这是否足够安全:它是 not documented (or at least I could not find any doc for it), only available as implementation, f.i. in the extracted modena.css
我使用下面的代码来摆脱文本区域自动生成的焦点效果:
* {
-fx-focus-color: transparent;
-fx-border-style: none;
}
或
.textarea {
-fx-focus-color: transparent;
-fx-border-style: none;
-fx-background-radius: 0.0px;
-fx-border-radius: 0.0px;
}
要删除所有默认样式,包括圆形边框...
我想知道如何更改出现在文本区域中的内边框颜色。我想删除文本区域红色边框内的蓝色透明边框。我检查了 modena.css 文件,但找不到解决方案。
我的 css 文件中的内容:
.text-area:focused {
-fx-background-color: white;
-fx-border-color: rgba(229,0,0,0.3);
}
TextArea 的内容有一个额外的 border/background。要 change/get 摆脱它,您需要在 css.
中添加一个样式类似
.text-area:focused .content {
-fx-background-color: white;
}
不确定这是否足够安全:它是 not documented (or at least I could not find any doc for it), only available as implementation, f.i. in the extracted modena.css
我使用下面的代码来摆脱文本区域自动生成的焦点效果:
* {
-fx-focus-color: transparent;
-fx-border-style: none;
}
或
.textarea {
-fx-focus-color: transparent;
-fx-border-style: none;
-fx-background-radius: 0.0px;
-fx-border-radius: 0.0px;
}
要删除所有默认样式,包括圆形边框...