JavaFx不需要的白色角落 - TextArea

时间:2017-05-24 22:09:13

标签: java user-interface javafx

我想将TextArea的颜色更改为黑色,并且我使用CSS稍微改变了设计。但是还有一些不需要的白点,我不知道如何删除它们。

enter image description here

.black-card{
-fx-text-fill: #d4d4d4;
-fx-control-inner-background: #1b191a;
-fx-text-box-border: transparent;
-fx-faint-focus-color: transparent;
-fx-focus-color: transparent;
-fx-prompt-text-fill: #a2a2a2;
-fx-background-radius: 0;

这是我的TextArea的css代码,我将样式设置为mytextarea.getStyleClass().add("black-card");

更改根背景颜色并没有改变这一点,所以我的结论是我在CSS代码中做错了但似乎无法找到我的错误。

先谢谢贾斯珀。

1 个答案:

答案 0 :(得分:2)

将背景半径应用于文本区域的内容:

.black-card{

    -fx-text-fill: #d4d4d4;
    -fx-control-inner-background: #1b191a;
    -fx-text-box-border: transparent;
    -fx-faint-focus-color: transparent;
    -fx-focus-color: transparent;
    -fx-prompt-text-fill: #a2a2a2;

}
.black-card .content {
    -fx-background-radius: 0 ;
}