2013-04-08 74 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它會解決你的問題。