我有一组使用PopupView
. 自 Charm 4.0.0 更新以来,它们表现出一些奇怪的行为。
当我选择一个Node
包含在 PopupView 中时,PopupView 用来关闭。现在 PopupView 被关闭但立即再次出现。此外,一旦我在 PopupView 外部单击它就会关闭,但我无法再次显示它。
我已经使用Gluon javadoc中的示例对其进行了测试,并在第二个问题上遇到了相同的行为:
public class MyApp extends MobileApplication{
private Button button;
private PopupView popupView;
@Override
public void init() {
addViewFactory(HOME_VIEW, () -> {
button = new Button("Click");
button.setOnAction(event -> popupView.show());
popupView = new PopupView(button);
VBox vBox = new VBox();
vBox.getChildren().addAll(new Label("Choice 1"), new Label("Choice 2"), new Label("Choice 3"));
vBox.setSpacing(5);
popupView.setContent(vBox);
return new View(button) {
@Override
protected void updateAppBar(AppBar appBar) {
appBar.setTitleText("PopupView");
}
};
});
}
}