【问题标题】:iPad landscape mode only with UINavigationController [closed]iPad 横向模式仅与 UINavigationController [关闭]
【发布时间】:2013-04-11 11:02:56
【问题描述】:

我正在制作一个仅支持横向模式的 iPad 应用程序,但是当我在我的应用程序中添加 navigationController 时,即使模拟器默认设置为横向模式,我的应用程序视图也是纵向的。仅当我尝试添加 UINavigationController 时才会发生这种情况。

任何帮助将不胜感激,谢谢。

【问题讨论】:

    标签: ios ios6 ios-simulator ipad


    【解决方案1】:

    子类 UINavigationController 并添加这些方法:

    - (NSUInteger)supportedInterfaceOrientations {
        return UIInterfaceOrientationMaskLandscape;
    }
    - (BOOL)shouldAutorotate {
        return YES;
    }
    

    【讨论】:

      【解决方案2】:

      您必须在您的应用程序目标摘要中设置支持接口方向:

      【讨论】:

      • 是的,这是我做的第一件事。但是,问题仍然存在。
      • 啊。我明白了……有另一个可能的解决方案。
      猜你喜欢
      • 1970-01-01
      • 2011-02-08
      • 1970-01-01
      • 2021-07-06
      • 2012-03-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-07-04
      相关资源
      最近更新 更多