【发布时间】:2018-03-15 18:49:38
【问题描述】:
这是我的样式:
.pagination .pagination-control .button, .pagination .toggle-button {
-fx-background-color: -fx-paginator-button;
-fx-border-color: -fx-colour-dark-grey;
}
.pagination .pagination-control .toggle-button:selected {
-fx-background-color: -fx-colour-purple;
}
.pagination .pagination-control .toggle-button:hover, .pagination .pagination-control .button:hover {
-fx-background-color: -fx-bg-colour-grey;
}
.pagination .pagination-control .left-arrow, .right-arrow{
-fx-background-color: -fx-font-colour-black;
}
.pagination .label {
-fx-text-fill: -fx-font-colour-black;
}
这是结果:
背景颜色似乎有问题。当按钮被选中时,它在底部溢出一点,对于箭头按钮,背景不会应用于整个按钮(如果你非常仔细地看最右边的箭头按钮,背景颜色会结束,留下一个白色的小条)。另外我如何增加按钮的大小(它们比现实中的图像小)?我试过像这样设置 prefWidth 和 prefHeight 没有结果
.pagination .pagination-control .button, .pagination .toggle-button {
-fx-background-color: -fx-paginator-button;
-fx-border-color: -fx-colour-grey;
-fx-pref-width: 15;
-fx-pref-height: 15;
}
【问题讨论】: