2016-07-30 96 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