我想让ChoiceBox透明化,使它看起来像一个标签。是否可以隐藏右侧和背景上的箭头?弹出窗口应该是默认的。 我必须在这里使用哪些CSS类?
祝你好运
答案 0 :(得分:2)
以下是如何操作coice框内的节点:
.choice-box > .open-button > .arrow{
/* Example: -fx-opacity: 0; */
}
您基本上只需要遍历选项框内的所有节点,以便能够操纵箭头。
如果您需要任何进一步的信息,我会提供,如果我可以:)
希望它有所帮助,
Laurenz
编辑:这是完整的解决方案:
.choice-box > .open-button > .arrow{
-fx-opacity: 0;
}
.choice-box{
-fx-background-color: transparent;
}
EDIT2:如何在已应用id / class的节点上使用css?
#mycombobox > .open-button > .arrow{
-fx-opacity: 0;
}
#mycombobox{
-fx-background-color: transparent;
}
与CSS类一起使用:
.mycombobox > .open-button > .arrow{
-fx-opacity: 0;
}
.mycombobox{
-fx-background-color: transparent;
}