作为标题,是否可以将默认颜色应用于 TextFlow 组件的所有文本?
TextFlow textFlow = new TextFlow();
textFlow.setId("supertextflow");
// Somewhere else in the code
textFlow.getChildren()
.add(new Text("Dynamic added text! OMG!"));
我尝试了不同的解决方案,但它们都不起作用
#supertextflow {
-fx-text-fill: red;
}
#supertextflow * .text{
-fx-fill: red;
}
#supertextflow > * > .text {
-fx-fill: red;
}
我知道 Text 是另一个组件,但为什么我不能从它的父级设置它的样式?