2016-07-30 53 views
2

我想改变使用css样式表的javafx微调样式。使用css更改javafx微调按钮的样式

但是,在更改颜色时,我只能更改文本字段的颜色,并且箭头按钮位于微调器一侧仍然看起来像默认值。

如何更改这些按钮的颜色?

回答

2

集被用作背景的按钮-fx-body-color

.spinner .increment-arrow-button, 
.spinner .decrement-arrow-button { 
    -fx-body-color: yellow; 
} 

.spinner .increment-arrow-button:hover, 
.spinner .decrement-arrow-button:hover { 
    /* interpolate color between yellow and red based on first color brightness */ 
    -fx-body-color: ladder(#444, yellow 0%, red 100%); 
} 

.spinner .increment-arrow-button:hover:pressed, 
.spinner .decrement-arrow-button:hover:pressed, 
.spinner .increment-arrow-button:pressed, 
.spinner .decrement-arrow-button:pressed { 
    /* interpolate color between yellow and red based on first color brightness */ 
    -fx-body-color: ladder(#AAA, yellow 0%, red 100%); 
} 

那些被默认的样式表作为按钮的背景颜色使用。

+0

谢谢!我将如何改变实际箭头的颜色?当按钮变暗时,箭头图标 – FrancisG

+0

之间没有足够的对比度不要担心我已经知道了,我的问题是我没有正确解释javafx css参考指南,非常感谢您的帮助! – FrancisG