是否可以用主色填充所选ComboBox单元的一角(它保持白色而不是#2f4f4f)。
这是我的CSS代码:
.combo-box {
-fx-border-color: #000000;
-fx-border-width: 1;
-fx-background-radius: 0;
-fx-background-color: #2f4f4f;
-fx-font-family: "Arial";
-fx-font-size: 12px;
-fx-text-fill: #ffffff;
-fx-background-insets: 0;
-fx-alignment: center;
-fx-content-display: center;
}
.combo-box > .cell {
-fx-text-fill: #ffffff;
-fx-alignment: center;
}
.combo-box:hover {
-fx-background-color: #87cefa;
}
.combo-box-popup .list-view .list-cell {
-fx-background-color: #2f4f4f;
-fx-text-fill: #ffffff;
-fx-text-alignment: center;
}
.combo-box-popup .list-view .list-cell:filled:selected,
.combo-box-popup .list-view .list-cell:filled:selected:hover {
-fx-background: #2f4f4f;
-fx-background-color: #87cefa;
-fx-text-fill: #ffffff;
-fx-text-alignment: center;
}
.combo-box-popup .list-view .list-cell:filled:hover {
-fx-background-color: #87cefa;
-fx-text-alignment: center;
-fx-background-radius: 10.0;
}
答案 0 :(得分:0)
将此添加到您的CSS样式:
.combo-box-popup .list-view {
-fx-background-color: #2f4f4f;
}