.slider .track {
-fx-pref-width: 300px;
}
.slider .axis-tick-label {
-fx-text-fill: white;
}
我为 slider 编写 CSS 样式的微弱尝试都不起作用。我 100% 确定我的语法不对。有帮助吗?
最佳答案
您可以通过设置 slider
的 -fx-pref-width
属性和设置 -fx-tick-label-fill
.slider .axis
的属性:
.slider { -fx-pref-width: 300px; }
.slider .axis { -fx-tick-label-fill: white; }
Note: For vertical Slider
, to affect the length of the track, you have to use the -fx-pref-height
attribute:
.slider:vertical { -fx-pref-height:300px; }
关于JavaFX Slider : Track length? 刻度标签颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44061828/