[英]How to change programatically height of Anchor Pane on demand?
我有垂直的SplitPane
並希望通過單擊按鈕以編程方式更改內部AnchorPane
的大小。 到目前為止,我有
@FXML
private void handleToggleBottomAction(ActionEvent event) {
event.getEventType().getName();
if(bottomToggledUp){
bottomToggledUp = false;
//hide bottom pane
apBottomPane.setPrefHeight(15);
apMapPane.setPrefHeight(750);
apBottomPane.requestLayout();
} else {
// view bottom pane
bottomToggledUp=true;
apBottomPane.setPrefHeight(100);
apMapPane.setPrefHeight(650);
apBottomPane.requestLayout();
}
}
但這不會改變他們嗎? 如何解決呢?
使用AnchorPane.setMinSize(double,double);
現在他們將被迫遵守
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.