如 borderpane 的 javafx 文档所述 here ,
If the window is smaller than the space needed for the contents of each region, the regions might overlap. The overlap is determined by the order in which the regions are set. For example, if the regions are set in the order of left, bottom, and right, when the window is made smaller, the bottom region overlaps the left region and the right region overlaps the bottom region.
我有顶部和底部面板,它们是从 fxml 预定义的,中间面板由以编程方式更新的 ImageView 组成。我需要始终显示顶部和底部 Pane 。但是,当我调整应用程序窗口大小时,顶部 Pane 消失了。据我了解,这是因为中心 Pane 是最后更新的(根据文档)。如何设置此元素固定?我尝试在我的 fxml 文件中设置 minHeight="100.00"
,但这不起作用。
最佳答案
确保在 FXML 文件的中心之后定义顶部和底部区域:
<BorderPane>
<center><!-- ... --></center>
<top><!-- ... --></top>
<bottom><!-- ... --></bottom>
</BorderPane>
关于java - 如何固定边框节点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34735594/