使用自定义CSS时,JavaFX表上的滚动条会留下空白

使用自定义CSS时,JavaFX表上的滚动条会留下空白,css,javafx,javafx-8,Css,Javafx,Javafx 8,一幅画胜过千言万语: 正如你所看到的,我在这个表上使用自定义CSS,但我不能填充右上角。我尝试更改滚动窗格的背景,但没有结果 下面是实际的CSS: .table-row-cell { -fx-background-color: rgba(71, 81, 80,0.5); } .table-row-cell:hover { -fx-background-color: rgba(40, 96, 93, 0.50); } .table-row-cell:hover:empty {

一幅画胜过千言万语:

正如你所看到的,我在这个表上使用自定义CSS,但我不能填充右上角。我尝试更改滚动窗格的背景,但没有结果

下面是实际的CSS:

.table-row-cell {
  -fx-background-color: rgba(71, 81, 80,0.5);
}

.table-row-cell:hover {
  -fx-background-color: rgba(40, 96, 93, 0.50);
}

.table-row-cell:hover:empty {
  -fx-background-color: rgba(71, 81, 80,0.5);
}

.table-row-cell .table-cell {
  -fx-border-width: 0px;

}

.table-view {
  -fx-border-color: rgba(1, 11, 12, 1);
  -fx-background-radius: 2;
  -fx-border-width: 1px;
  -fx-border-radius: 2;
  -fx-background-color: rgba(71, 81, 80,0.2);
  -fx-background-insets: 0;
}

.table-view .column-header {
  -fx-background-color: rgba(1, 11, 12, 1);
}

.scroll-bar {
  -fx-background-color: rgba(1, 11, 12, 1);
}

.scroll-bar .increment-button:hover {
  -fx-background-color: rgba(1, 11, 12, 1);
}

.scroll-bar .decrement-button:hover {
  -fx-background-color: rgba(1, 11, 12, 1);
}

.scroll-bar .thumb {
  -fx-background-color: rgba(71, 81, 80,0.5);
}

非常感谢您的帮助。

我终于找到了解决方法,感谢@James\D帮助我找到解决方案

该角不是滚动窗格的一部分,而是table.view标题。因此,您可以使用此代码更改背景

填充物是必要的,因为它会在右侧留下一条奇怪的白线,没有填充物

.table-view .column-header-background .filler {
  -fx-background-color: rgba(1, 11, 12, 1);
  -fx-padding: 1em;
}

如果您能找到更好的方法来实现这一点,欢迎您的回答。

尝试使用
.table view.filler{-fx background color:…}