ios - 当 UIViewController 呈现 UIViewControllerAnimatedTransitioning 并在 iOS8 中旋转时,UITabBarController 布局被破坏

标签 ios iphone uiviewcontroller

我在 iOS8 中遇到旋转问题。在 iOS7 中,没问题。

样本下载:https://www.dropbox.com/s/jr067r3jpzit10h/Rotation.zip?dl=0

步骤如下。

  1. 在 XCode 6 中创建基于标签栏的 iOS 项目。
  2. 在项目设置中设置设备方向以支持纵向、横向左、横向右。
  3. 让标签栏 Controller 仅通过代码支持纵向。(shouldAutorotate 返回 true,supportedInterfaceOrientations 返回 UIInterfaceOrientationMask.Portrait)
  4. 通过 presentViewController:animated:completion 在标签栏中的第一个 View Controller 中呈现一个 View Controller 。通过设置 transitioningDelegate 使用自定义过渡。(我为此做了一个简单的淡入/淡出过渡委托(delegate))模态视图支持各种方向。(shouldAutorotate 返回 true)
  5. 在模态视图中,旋转设备。
  6. 关闭模态视图。
  7. View 像这样崩溃了。

enter image description here

有人可以帮忙吗?

最佳答案

我有类似的东西,但我将 TabController 放在导航 Controller 中,并在我的自定义导航 Controller 中执行此操作:

- (BOOL)shouldAutorotate {
return self.topViewController.shouldAutorotate;

关于ios - 当 UIViewController 呈现 UIViewControllerAnimatedTransitioning 并在 iOS8 中旋转时,UITabBarController 布局被破坏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26227599/

相关文章:

ios - 来自 UIWebview 的 PDF 发送到 "Open In..."菜单中的应用程序

ios - 在 UIPageViewControllers 中预加载所有 UIViewControllers (Swift)

ios - Swift 3 UIStatusBarStyle 不适用于 UINavigationController 中的单独 ViewController

ios - iOS 应用程序需要 2GB RAM

更改方向后,iOS8 无法重新调整模态表单的大小

iphone - 将一个 AAC 文件附加到另一个文件时的输出音频设置

iphone - iOS 如何使 UITabBar 和 UINavigationController 变暗而不隐藏它们?

iphone - 从 View Controller 访问模型?

ios - 使用 AVMutableVideoComposition 导出时出现视频方向问题

iPhone:UITableViewController 中的触摸点捕获