我有一个包含几列和几行的TableView。 这是CSS的摘录:
.table-view {
-fx-font-size: 8.0pt;
}
.table-row-cell {
-fx-cell-size: 1.8em;
}
在单元工厂中是:
StringBuilder style = new StringBuilder();
if (item.getWeight() != null) {
style.append("-fx-font-weight: ").append(item.getWeight()).append("; ");
}
if (item.getTextColor() != null) {
style.append("-fx-text-fill: ").append(item.getTextColor().toString().replace("0x","#")).append("; ");
}
if (item.getBackgroundColor() != null) {
style.append("-fx-background-color: ").append(item.getBackgroundColor().toString().replace("0x","#")).append("; ");
}
setStyle(style.toString());
现在,问题是当我设置背景颜色时,背景变得比单元格高度大。
我找不到问题所在。