[英]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.