2
這隻適用於,如果您是在由導航控制器管理的視圖控制器中呈現。問題與definesPresentationContext/UIModalPresentationCurrentContext - 當前上下文視圖控制器丟失
再現步驟是:
1 - 現在使用UIModalPresentationCurrentContext
self.definesPresentationContext = YES;
ViewController* viewController = [[ViewController alloc] init];
viewController.modalPresentationStyle = UIModalPresentationCurrentContext;
[presentOnViewController presentViewController:viewController animated:YES completion:nil];
2的圖控制器 - 使用默認全屏呈現樣式
ViewController* viewController = [[ViewController alloc] init];
[self presentViewController:viewController animated:YES completion:nil];
出示過頂視圖控制器
3 - 關閉頂級顯示控制器(全屏顯示控制器)
[self dismissViewControllerAnimated:YES completion:nil];
現在的問題是第二個視圖控制器(呈現使用UIModalPresentationCurrentContext)消失。此外,使用UIModalPresentationCurrentContext顯示另一個視圖控制器是不可能的,因爲系統認爲它仍然存在。
對不起,我已經刪除了我的錯誤答案。我在一個非常簡單的項目中測試了這種情況,並很容易地確認了問題。我希望你已經向蘋果提交了一份錯誤報告;我當然會去的。 – matt
是...提交錯誤報告。 – Robert
謝謝,這真是奇怪的問題。非常感謝。 –