【发布时间】:2013-02-21 23:36:07
【问题描述】:
我有一个使用以下代码显示的模式对话框:
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();
}
我得到了这个结果(这是我所期望的):
现在我想通过敲出对话框的灰色内容来实现关闭对话框。我该怎么做?对话框本身继承自 UIViewController。
【问题讨论】:
-
已接受答案中的解决方案不适用于带有 Xamarin.Forms 2.5.0 的 iOS 11.2,您最近有这种方法吗?
标签: dialog xamarin.ios modal-dialog