2017-06-19 48 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

相關問題