0
一個問我問了好幾百次但我知道沒人知道如何去做。JavaFX FXML組件填充父項 - 比如Android中的alignParent
我有一個BorderPane,並希望將畫布作爲BorderPane的底部。我希望畫布填充整個底部。我不想硬編碼任何值。 它甚至有可能嗎?
在Android中我有類似alignParentTop等東西。在JavaFX中這真的不直觀。
<BorderPane fx:controller="pl.mg.checkers.controller.GameController"
xmlns:fx="http://javafx.com/fxml">
<top>
<HBox>
<Button fx:id="leaveButton" text="Leave"/>
</HBox>
</top>
<bottom>
<Canvas fx:id="canvas"/>
</bottom>
</BorderPane>
可能的重複:http://stackoverflow.com/questions/23449932/javafx-resize-canvas-when-screen-is-resized – Itai