【发布时间】:2016-07-18 08:30:19
【问题描述】:
因为我的规则已经到位,但这些错误却毫无进展。我试图了解网络上可用的解决方案,但没有一个对我有用。
Jul 18, 2016 1:39:17 PM javafx.scene.CssStyleHelper calculateValue WARNING: Could not resolve '-fx-tab-border-color' while resolving lookups for '-fx-background-color' from rule '*.tab-pane>*.tab-header-area>*.control-buttons-tab' in stylesheet file ***style.css***
上面提到了很多类似的警告,由于某些组件无法正确加载。使用Java1.8.0_66。
我的 css 文件中的 root 是这样的:
.root {
-fx-base: #d0d0d0;
-fx-background: #f4f4f4;
-fx-control-inner-background: white;
-fx-font-family:"Courier";
-fx-font-size: 12;
-fx-dark-text-color: black;
-fx-mid-text-color: #292929;
-fx-light-text-color: white;
-fx-accent: #0093ff;
-fx-focus-color: #0093ff;
-fx-color: -fx-base;
-fx-disabled-opacity: 0.9;
-fx-hover-base: ladder(
-fx-base,
derive(-fx-base,20%) 20%,
derive(-fx-base,30%) 35%,
derive(-fx-base,40%) 50%
);
-fx-pressed-base: derive(-fx-base,-20%);
-fx-focused-base: -fx-base;
-fx-tab-border-color: -fx-box-border;
-fx-background-color: inherit;
-fx-background-radius: inherit;
-fx-background-insets: inherit;
-fx-padding: inherit;
-fx-cell-hover-color: #cce3f4;
-fx-cell-focus-inner-border: #85b9de;
-fx-page-bullet-border: #acacac;
-fx-page-indicator-hover-border: #accee5;
}
它被用于:
.tab-pane > .tab-header-area > .control-buttons-tab {
-fx-background-color: -fx-tab-border-color, -fx-inner-border, -fx-body-color;
-fx-background-insets: 0, 1, 2;
-fx-background-radius: 5 5 0 0, 4 4 0 0, 3 3 0 0;
-fx-padding: 0.083333em 0.25em 0.083333em 0.25em; /* 1 3 1 3 */
}
是同一个css文件。
提前致谢!!
【问题讨论】:
-
无法复制。尝试将
-fx-tab-border-color修改为例如TAB_BORDER_COLOR. -
对我来说很好。您可能不应该为自己查找的颜色定义使用
-fx前缀,但它工作得很好。 -
@James_D 我已经提到了 css .root 内容和问题描述中使用的 css 内容。我可以看到,
-fx没有问题。我在-fx-disabled-opacity面临同样的问题。 -
有两个人尝试了您发布的代码,但无法重现错误。因此,可以合理地假设您正在使用的代码中存在错误,而您发布的代码中不存在该错误,或者错误是由代码的其他部分引起的。
-
对于
-fx-disabled-opacity:JavaFX CSS 中没有定义这样的属性,您不能像定义颜色一样为数值定义“查找值”。跨度>
标签: css javafx javafx-8 javafx-css