2017-06-19 61 views
1

我无法从另一个模态视图控制器显示模态视图控制器。我有第一个ViewController(vc1),因为我点击一个uibutton以模态方式呈现视图控制器(vc2),在vc2中,我点击uibutton以模态方式呈现另一个视图控制器vc3。所以我没有看到vc2上的vc3。在VC2按钮点击从另一个模态视图控制器提供ModalViewcontroller

我的示例代码:

var vc3 = new UIViewController(); 
vc3.ModalPresentationStyle = UIModalPresentationStyle.CurrentContext; 
((UINavigationController)UIApplication.SharedApplication.Windows[0].RootViewController).VisibleViewController.PresentViewController(vc3, true,null); 

回答

1

对于这个您首次提出模态视图控制器必须是全屏。在呈现之前,它改变其ModalPresentation风格。

var yourOtherModalViewController = new YourOtherModalViewController(); 
yourOtherModalViewController.ModalPresentationStyle = UIModalPresentationStyle.FullScreen; 
+0

谢谢,它的工作。 – lavanya

+0

@lavanya良好的工作。你能将这个问题标记为答案吗? – apineda

相关问题