css - JavaFX SceneBuilder 样式表
问题描述
我目前正在尝试通过 SceneBuilder 将样式表添加到我的场景中,但是目前我似乎遇到了一些问题。
-fx-background-color:
linear-gradient(#686868 0%, #232723 25%, #373837 75%, #757575 100%),
linear-gradient(#020b02, #3a3a3a),
linear-gradient(#9d9e9d 0%, #6b6a6b 20%, #343534 80%, #242424 100%),
linear-gradient(#8a8a8a 0%, #6b6a6b 20%, #343534 80%, #262626 100%),
linear-gradient(#777777 0%, #606060 50%, #505250 51%, #2a2b2a 100%);
目前我正在尝试使用该段为HBox
我的Scene
.
如果需要,看看我的 FXML:
<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<bottom>
<HBox stylesheets="@styles/bottomRow.css" BorderPane.alignment="CENTER">
<children>
<Label fx:id="nameOfImage" text="nameOfImage" />
<Region HBox.hgrow="ALWAYS" />
<Label fx:id="sizeOfImage" text="sizeOfImage" />
</children>
<opaqueInsets>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</opaqueInsets>
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding>
</HBox>
</bottom>
<top>
<VBox BorderPane.alignment="CENTER">
<children>
<MenuBar>
<menus>
<Menu mnemonicParsing="false" text="File">
<items>
<MenuItem mnemonicParsing="false" text="Close" />
</items>
</Menu>
<Menu mnemonicParsing="false" text="Edit">
<items>
<MenuItem mnemonicParsing="false" text="Delete" />
</items>
</Menu>
<Menu mnemonicParsing="false" text="Help">
<items>
<MenuItem mnemonicParsing="false" text="About" />
</items>
</Menu>
</menus>
</MenuBar>
</children>
</VBox>
</top>
<center>
<HBox prefHeight="100.0" prefWidth="200.0" BorderPane.alignment="CENTER">
<children>
<Region prefHeight="200.0" prefWidth="200.0" />
<ImageView cacheHint="SCALE" depthTest="ENABLE" fitHeight="150.0" fitWidth="200.0" nodeOrientation="INHERIT" pickOnBounds="true" preserveRatio="true" HBox.hgrow="ALWAYS">
<viewport>
<Rectangle2D />
</viewport>
</ImageView>
<Region prefHeight="200.0" prefWidth="200.0" />
</children>
</HBox>
</center>
</BorderPane>
我之前设法使用线性渐变,但是我不确定这里出了什么问题。目前它应该给它上色,HBox
但目前它留下一个白色的石板,没有一丝颜色。我试图找到更好的方法来.css
查看该部分是否正确,但它们或多或少看起来都一样。
解决方案
推荐阅读
- macos - 应用程序“App.app”无法打开
- kubernetes - GCE入口多路径通配符问题
- android - Dialog(Date) & Spinner(Dropdown) 可以被认为是一个字符串?如何将其存储到数据库中?我试图解释更多我所面临的
- javascript - 从nodejs服务器将数据发送到另一个html中的对象
- javascript - 如何在一次调用中分配多个 html 元素值?
- angular6 - Summernote Angular 6 CLI 注释或注释
- python - 在当前活动目录上运行存储在服务器上的 python 脚本
- vim - Vim 语法高亮之后
- matlab - 加速动画
- java - 使用 JNA 执行 WMI 时执行 IWbemServices.ExecQuery 时出现问题