[問題] ViewController間的切換

看板MacDev作者 (-.-)時間11年前 (2013/05/08 14:18), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串1/1
大家好,目前我程式的架構是 RootViewController (Rotated) ---ViewController1 (NonRotated) ---ViewController2 (Rotated) 我會在RootViewController.m裡面 [self presentViewController:viewController1 animated:YES completion:nil]; ,然後我的ViewController會告訴RootViewController,請它切換到ViewController2 然後我會這樣做,如下 [self dismissViewControllerAnimated:NO completion:nil]; [self presentViewController:viewController2 animated:YES completion:nil]; 可以這樣做會看到RootViewControlle的View, //////////////////////////////////////////////////////////////////////////// 有沒有辦法能做到如同我在ViewController1裡面做 [self presentViewController:viewController2 animated:YES completion:nil]; 此時的架構會比較像 RootViewController----ViewController1----ViewController2 謝謝... -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 118.163.14.75 ※ 編輯: s8911124 來自: 118.163.14.75 (05/08 14:23)

05/08 18:29, , 1F
可以在dismiss的completion裡用block完成它
05/08 18:29, 1F
[self dismissViewControllerAnimated:NO completion:^{ [self presentViewController:viewController2 animated:YES completion:nil];}]; 還是看的到RootViewController的View底圖。 是我誤會了嗎? ※ 編輯: s8911124 來自: 118.163.14.75 (05/09 15:30)
文章代碼(AID): #1HYUuukD (MacDev)