![](/img/trans.png)
[英]Dismiss current modal view controller and then present new modal view controller
[英]Black screen when present new controller and dismiss current controller
當前我有3個控制器,A,B和C。我在AController
單擊一個按鈕,然后顯示BController
,然后在BController
調用一個api,如果成功,我將轉到CController
,但是我想同時關閉BController
時間。 然后我成功調用了CController
另一個api,當我關閉CController
,希望屏幕返回到Acontroller
。 這三個控制器均不在導航控制器堆棧中。
我的實現:
在BController
,調用presentViewController:(CController)
方法和dismissViewController:(self)
,但是我失敗了,屏幕上沒有黑色的東西,希望有人可以幫助我解決這個問題。
謝謝!
然后執行以下操作:
1) A -> present B
2) B executes some method and if it is success -> delegate method to A,
f.e (void)bControllerDidSuccess
3) in A Controller delegate method (void)bControllerDidSuccess:
A dismissViewController; // A dissmising B
A presentViewController:C // A presenting C
只需按常規方法,並在要關閉CController時添加此行
[self.navigationController popToRootViewControllerAnimated:YES];
請執行下列操作:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.