我尝试用我的图标替换 TreeView 中的默认箭头图标。问题是我的图标被裁剪了,尽管它只有 9x9 像素。要替换图标,我按照 stackoverflow 上的建议使用 CSS:
.tree-cell > .tree-disclosure-node > .arrow {
-fx-background-color: null;
-fx-background-image: url("plus-icon.gif");
}
.tree-cell:expanded > .tree-disclosure-node > .arrow {
-fx-background-color: null;
-fx-background-image: url("minus-icon.gif");
}
但这使我的小图标被裁剪(剪切):
我试图通过使用 css 和填充来改变这一点,但它没有帮助。
谢谢!