我已将 IMvXModelTouchView 用于自定义弹出屏幕动画。而且,我在这个弹出视图上有一个关闭按钮。切换回先前视图的正确方法是什么?
这是我的代码:
public class PopupView
: MvxViewController, IMvxModalTouchView
{
public PopupView()
{
ModalPresentationStyle = UIModalPresentationStyle.PageSheet;
}
public override void ViewDidLoad()
{
Title = "Map";
base.ViewDidLoad();
var closeButton = new UIButton(new RectangleF(0, 0, 50, 30));
closeButton.TouchUpInside += CloseButtonClicked();
Add(closeButton);
}
private EventHandler CloseButtonClicked()
{
return (sender, args) => NavigationController.DismissViewController(true, null);
}
}
当我第一次单击此关闭按钮时它起作用了,但是当我尝试再次弹出此视图时它崩溃了。