JavaFx不必要的白色角落-TextArea [英] JavaFx unwanted white Corner - TextArea
问题描述
我想将TextArea的颜色更改为黑色,并且通过使用CSS对设计进行了一些更改.但是还有一些不需要的白点,我不知道如何去除它们.
I want to change my TextArea's colour to black and I've changed the design a bit by using CSS. But there are some unwanted white spots left and I don't know how to remove them.
.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");
This is my css code for the TextArea and im setting the Style with mytextarea.getStyleClass().add("black-card");
更改根背景颜色对此没有任何改变,所以我的结论是我在CSS代码中做错了一些,但似乎找不到我的错误.
Changing the root-background colour doesn't change anything about this, so my conclusion is that I've done something wrong in the CSS code but can't seem to find my Error.
预先感谢,贾斯珀.
推荐答案
将背景半径应用于文本区域的内容:
Apply the background radius to the text area's content:
.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 ;
}
这篇关于JavaFx不必要的白色角落-TextArea的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!