我在 iOS8 中遇到旋转问题。在 iOS7 中,没问题。
样本下载:https://www.dropbox.com/s/jr067r3jpzit10h/Rotation.zip?dl=0
步骤如下。
- 在 XCode 6 中创建基于标签栏的 iOS 项目。
- 在项目设置中设置设备方向以支持纵向、横向左、横向右。
- 让标签栏 Controller 仅通过代码支持纵向。(shouldAutorotate 返回 true,supportedInterfaceOrientations 返回 UIInterfaceOrientationMask.Portrait)
- 通过 presentViewController:animated:completion 在标签栏中的第一个 View Controller 中呈现一个 View Controller 。通过设置 transitioningDelegate 使用自定义过渡。(我为此做了一个简单的淡入/淡出过渡委托(delegate))模态视图支持各种方向。(shouldAutorotate 返回 true)
- 在模态视图中,旋转设备。
- 关闭模态视图。
- View 像这样崩溃了。
有人可以帮忙吗?
最佳答案
我有类似的东西,但我将 TabController 放在导航 Controller 中,并在我的自定义导航 Controller 中执行此操作:
- (BOOL)shouldAutorotate {
return self.topViewController.shouldAutorotate;
关于ios - 当 UIViewController 呈现 UIViewControllerAnimatedTransitioning 并在 iOS8 中旋转时,UITabBarController 布局被破坏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26227599/