2013-09-26 64 views
1

我有一個BorderPane和一個AnchorPane佈局。如何自動調整Borderpane的內容?

當我試圖將AnchorPane插入到BorderPane中,並且我最大化或最小化BorderPane時,AnchorPane不會根據其父(BorderPane)調整自身大小。

我嘗試將AnchorPane放到BorderPane的中心,並使其可自動更改。但它不工作。

parent.setCenter(anchorPane); 
anchorPane.autoresize(); 

如何設置AnchorPane及其BorderPane家長,讓通過調整父兒童調整自身的大小?

回答

0

檢查:BorderPaneDoc

BorderPane榮譽最小,首選,其 兒童的最大尺寸。如果孩子的可調整範圍阻止其調整大小 以適合其位置

確保您的錨定窗格沒有最大大小。

相關問題