如何更改滚动条中箭头图形的大小?

是否可以使用CSS更改滚动条按钮中箭头图形的大小?

我希望箭头占据按钮的较大部分。如果设置了-fx-scale-shape: false,则可以通过手动缩放-fx-shape中的值来达到预期的效果。

.scroll-bar:vertical > .decrement-button > .decrement-arrow {
    -fx-shape: "M0,0 ........... z";
    -fx-position-shape: true;
    -fx-scale-shape: false;
}

但是,我觉得一个更好的主意是保留-fx-scale-shape: true而不是更改容器的大小,我只是不知道该怎么做。

yorita 回答:如何更改滚动条中箭头图形的大小?

您可以在CSS内设置-fx-pref-widthheight属性,然后设置-fx-scale-shape: true

.scroll-bar:vertical > .decrement-button > .decrement-arrow {
    -fx-pref-width: 7;
    -fx-pref-height: 7;
    -fx-shape: "M0,0 ........... z";
    -fx-position-shape: true;
    -fx-scale-shape: true;
}
本文链接:https://www.f2er.com/3141360.html

大家都在问