【问题标题】:screen rotation handling ios屏幕旋转处理ios
【发布时间】:2012-10-04 20:08:50
【问题描述】:

应用程序包含 5 个具有网格状层次结构的页面,即每个页面都可以从任何页面访问。每个页面都支持纵向和横向。

所以当从导航控制器推送和弹出视图控制器时,我无法处理旋转。

任何人都可以向我建议可用于实施上述方法的所需方法吗?

谢谢。

【问题讨论】:

    标签: iphone ios navigationcontroller screen-rotation


    【解决方案1】:

    这可能是 iOS 6 的问题。UINavigationController 不会自动调用supportedInterfaceOrientations:,除非你告诉它。

    查看此question 的答案。

    创建一个类别似乎是最好的解决方案。

    @implementation UINavigationController (iOS6OrientationFix)
    
    -(BOOL) shouldAutorotate {
        return [self.topViewController shouldAutorotate];
    } 
    
    -(NSUInteger) supportedInterfaceOrientations {
        return [self.topViewController supportedInterfaceOrientations];
    }
    
    @end
    

    【讨论】:

      猜你喜欢
      • 2021-11-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多