java - TabPane - 为什么我不能更改空选项卡区域的颜色?
问题描述
我正在尝试更改我正在处理的这个 JavaFX 项目中的灰色区域。我可以设法更改所有内容,但不能更改 TabPane 一侧的灰色区域。
我不确定是否必须按某种顺序设置 CSS 文件,或者我只是在这里遗漏了其他东西。
这是我的代码:
#tabPane {
-fx-background-color: #94C5E3;
-fx-tab-min-height: 64;
-fx-tab-max-height: 64;
-fx-tab-min-width: 64;
-fx-tab-min-width: 64;
-fx-padding: 0 -1- -1 0
}
.tab .tab-label {
-fx-background-color: transparent;
-fx-alignment: CENTER;
-fx-text-fill: #627796;
}
.tab{
-fx-background-color: #b5e4f6;
-fx-pref-width: 100;
-fx-background-insets: 0.0;
-fx-background-radius: 0.0;
-fx-padding: 0 30 0 30;
}
.tab:selected
{
-fx-background-color: #94C5E3;
-fx-background-radius: 0;
-fx-background-insets: 0;
-fx-border-width: 1 0 1 0;
-fx-border-height: 1 0 1 0;
-fx-border-color: transparent;
}
.tab:focused
{
-fx-background-color: #94C5E3;
-fx-focus-color: transparent;
}
.tab-tabPane *.tab-header-area .tab-header-background {
-fx-opacity: 0;
-fx-background-color: #b5e4f6;
}
.tab-pane:left *.tab-header-area
{
-fx-background-color: #94C5E3;
-fx-background-insets: 0, 0 0 10;
-fx-padding: 0.0em 0.0em 0.0em 0.0em;
}
.tab:selected .focus-indicator
{
-fx-focus-color: transparent;
-fx-border-color: transparent;
}
解决方案
推荐阅读
- python - python请求POST错误,会话问题?
- typescript - 为什么我在尝试从此类中检索数组时获得未定义?
- function - 在 Kotlin 中定义函数的不同方法
- python - 为什么我在我相当强大的 ubuntu 计算机上的 vsc 和它的集成 python 终端之间会有两秒的延迟?
- flutter - 为什么将类作为小部件而不是方法返回是编译时错误?
- amazon-web-services - 使用无服务器重新标记现有 AWS 资源
- ts-mockito - 未定义 IntersectionObserver
- magento2 - Magento 2 - 以编程方式更新多个商店的产品库存和价格
- machine-learning - Tensorflow中嵌入层的工作
- c - 是在共享函数内部还是外部使用互斥锁