【问题标题】:iPad App Orientation not changed in ios 6.1iOS 6.1 中的 iPad 应用程序方向未更改
【发布时间】:2013-04-08 13:12:57
【问题描述】:

我在两个方向都开发了 ipa 应用程序,但是 - (BOOL)shouldAutorotate {return YES;} 没有调用。

【问题讨论】:

  • 你在用navigationController吗?
  • 是的。我正在使用 UINavigationController
  • 您是否转到了应用目标、摘要选项卡并确保选择了所有支持的方向?

标签: iphone ios ipad orientation


【解决方案1】:

使用UINavigationController 会干扰viewControllers 的方向,要使其工作,您可以实现自定义 NavigationController 并在您的应用程序中使用它。您还应该确保您没有将子视图添加到您的窗口,如果您使用subView 到您的UIWindow,那么您将在控制台上收到警告。 Application windows are expected to have a root view controller at the end of application launch,如果您使用 subview,您的定位方法将不会被调用。正确的做法是

self.window.rootViewController = yourRootController;

Follow my answer for implementing UINavigationController它会解决你的问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-11-20
    • 2017-09-15
    • 1970-01-01
    • 2020-12-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多