以下是我的网格窗格的定义:
<GridPane fx:id="theGrid" hgap="5.0" vgap="5.0">
<columnConstraints>
<ColumnConstraints fx:id="theColumn" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints fx:id="theRow" minHeight="10.0" prefHeight="32.0" vgrow="NEVER" />
</rowConstraints>
</Gridpane>
我正在尝试将行高绑定到列宽,以便单元格完全正方形。我试着这样做,但没有成功:
<RowConstraints fx:id="theRow" minHeight="10.0" prefHeight="${theColumn.prefWidth}" vgrow="NEVER" />
有人可以告诉我是否可以这样做,谢谢。