【问题标题】:iOS 5 and iOS 6 UITabBarController MoreNavigationViewController rotationiOS 5 和 iOS 6 UITabBarController MoreNavigationViewController 旋转
【发布时间】:2012-10-01 23:16:28
【问题描述】:

我的项目基于具有多个 UINavigationContollers 的 UITabBarController。我正在调整应用程序以支持 iOS 6 中的旋转。我制作了 UITabBarController 的子类,以便可以阻止旋转。这很完美。但是 MoreNavigationViewController 有问题。在 iOS 5 上它会旋转,而在 iOS 6 上则不会。我的目标是阻止它。我必须支持所有方向(在 Info.plist 中),因为我使用的是 MPMoviePlayerViewController,它可以适应旋转。有没有办法继承 MoreNavigationViewController?

【问题讨论】:

    标签: ios ios5 uitabbarcontroller ios6


    【解决方案1】:

    如果有人遇到同样的情况,这就是我为解决它所做的:

    1. Info.plist 支持所有方向
    2. 在 UITabBarController 的自定义子类中我添加了这个方法

      - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{
              return UIInterfaceOrientationIsPortrait(interfaceOrientation); 
      }
      

    适用于 iOS 5 和 iOS 6。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-09-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多