开发者

FormSheet modal dialog won't hide

开发者 https://www.devze.com 2023-03-02 14:44 出处:网络
I have a modal dialog that I show using the following code: private void ShowUpdateDialog(f开发者_Go百科loat version, bool breakingChanges, string hint, string storeLink, string changelog, params str

I have a modal dialog that I show using the following code:

private void ShowUpdateDialog(f开发者_Go百科loat version, bool breakingChanges, string hint, string storeLink, string changelog, params string[] pars)
    {
        var dialog = new UpdatePopupController(this, new RectangleF(20, 20, 550, 600));
        dialog.WantsFullScreenLayout = true;
        dialog.ModalPresentationStyle = UIModalPresentationStyle.FormSheet;
        dialog.ModalTransitionStyle = UIModalTransitionStyle.FlipHorizontal;
        dialog.ModalInPopover = true;
        UIDevice.CurrentDevice.BeginGeneratingDeviceOrientationNotifications();
        dialog.ShowData(version, breakingChanges, hint, storeLink, changelog, pars);
        dialog.WillRotate(UIApplication.SharedApplication.StatusBarOrientation, 0);
        NavigationController.PresentModalViewController(dialog, true);
        dialog.BecomeFirstResponder();
    }

I get this result (that is what I expected):

FormSheet modal dialog won't hide

Now I want to implement closing the dialog by taping out of the gray content of the dialog. How can I do it? The dialog itself inherits from UIViewController.


Dont make it Modal. Then it works

dialog.ModalInPopover = false;


See this question which asks the same thing.

Personally I would have a button which upon TouchDown would dismiss the modal view.

0

精彩评论

暂无评论...
验证码 换一张
取 消