【发布时间】:2012-12-05 14:07:13
【问题描述】:
仅当您在由导航控制器管理的视图控制器中呈现时才会出现这种情况。
复制步骤是:
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 呈现另一个视图控制器,因为系统认为它仍然存在。
【问题讨论】:
标签: ios ipad cocoa-touch