我的javafx应用程序有一个CSS深色主题。一切正常,除了以下几点:选中某项后,表格视图中各列之间的蓝线:
这是我的css文件的样子:
.table-view {
-fx-base: #1d1d1d;
-fx-background-color: #1d1d1d;
-fx-control-inner-background: #1d1d1d;
-fx-table-cell-border-color: transparent;
-fx-table-header-border-color: transparent;
-fx-padding: 5;
}
.table-view .column-header-background {
-fx-background-color: transparent;
}
.table-view .column-header, .table-view .filler {
-fx-size: 35;
-fx-border-width: 0 0 1 0;
-fx-background-color: transparent;
-fx-border-color: transparent transparent derive(-fx-base, 80%) transparent;
-fx-border-insets: 0 10 1 0;
}
.table-view.column-header-background {
-fx-background-color: transparent;
}
.table-view .column-header .label {
-fx-font-size: 20;
-fx-font-family: "Segoe UI Light";
-fx-text-fill: white;
-fx-alignment: center-left;
-fx-opacity: 1;
}
.table-view:focused .table-row-cell:focused {
-fx-border-color: derive(-fx-base, 20%);
-fx-background-insets: 0 0 0 0;
}
.table-view:focused .table-row-cell:selected {
-fx-background-color: derive(-fx-base, 20%);
-fx-background-insets: 0 0 0 0;
}
答案 0 :(得分:2)
您应该将-fx-table-cell-border-color: transparent;
添加到CSS中。
要么创建一个新规则,例如:
.table-row-cell {
-fx-table-cell-border-color: transparent;
}
或仅将其添加到.table-view:focused .table-row-cell:focused
:
.table-view:focused .table-row-cell:focused {
-fx-border-color: derive(-fx-base, 20%);
-fx-background-insets: 0 0 0 0;
-fx-table-cell-border-color: transparent;
}
结果: