2013-04-08 69 views
1

我开发了两种方向的ipa应用程序,但不调用- (BOOL)shouldAutorotate {return YES;}iPad应用程序方向未在iOS 6.1中更改

+1

你使用的是navigationController吗? – nsgulliver 2013-04-08 13:14:13

+0

是的。我正在使用UINavigationController – 2013-04-08 13:16:19

+0

您是否已转至应用目标,摘要选项卡并确保选择了所有支持的方向? – 2013-04-08 13:28:40

回答

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它会解决你的问题。