JavaFX: Use custom Node as collapse / expand branch switch for TreeView

拈花ヽ惹草 提交于 2019-12-05 08:26:26

The -fx-shape css property of the arrows provides basic SVG shapes.

.tree-cell .tree-disclosure-node .arrow {
    -fx-background-color: -fx-mark-color;
    -fx-padding: 0.333333em; /* 4 */
    -fx-shape: "M 0 -4 L 8 0 L 0 4 z";    // <-- change this default triangle shape
}

.tree-cell:expanded .tree-disclosure-node .arrow {
    -fx-rotate: 90;                      // maybe another svg shape instead
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!