FormSheet模式对话框不会隐藏

时间:2011-05-04 12:42:07

标签: dialog xamarin.ios modal-dialog

我有一个模态对话框,我使用以下代码显示:

private void ShowUpdateDialog(float 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();
    }

我得到了这个结果(这就是我的预期):

Modal dialog showing

现在我想通过点击对话框的灰色内容来实现关闭对话框。我该怎么做?对话框本身继承自UIViewController。

2 个答案:

答案 0 :(得分:2)

不要让它成为模态。然后它工作

dialog.ModalInPopover = false;

答案 1 :(得分:1)

See this question which asks the same thing.

就个人而言,我会有一个按钮,TouchDown会关闭模态视图。