【发布时间】:2013-05-16 12:38:29
【问题描述】:
有时当我使用:[self presentViewController:viewController animated:YES completion:nil]; 或者即使模态转场处理了过渡,它只是弹出而没有任何过渡,使它看起来很难看。虽然很少见,但当这种情况发生时,每一个模态 VC 都会做同样的事情,不管它在哪里/如何被调用。当我重新启动应用程序时,问题就出现了,仅此而已,一段时间内不会再次发生。奇怪的是,在解雇 VC 时会有一个过渡。这是一个错误吗?
感谢您的帮助,
问候,
迈克
更新:我想我找到了原因。当我像这样展示我的教程视图时,这个错误会影响大多数模态 VC 和所有 Segue 模态 VC:
[tableView deselectRowAtIndexPath:indexPath animated:NO];
TutorialViewController *tutPopUp = [[TutorialViewController alloc] init];
self.tabBarController.modalPresentationStyle = UIModalPresentationCurrentContext;
[self presentModalViewController:tutPopUp animated:NO];
我认为问题在于self.tabBarController.modalPresentationStyle = UIModalPresentationCurrentContext;,它会影响整个标签栏。加载此特定 VC 后,我可以设置的默认值是多少?
回答:在阅读了一些 Apple Docs 之后,我发现默认的 modalPresentationStyle 是 UIModalPresentationFullScreen,所以在使用另一种presentationStyle 后将其设置为,修复它。
【问题讨论】:
标签: iphone ios objective-c