我有一個應用程序,通常是一個肖像應用程序,只顯示一個UIViewController的橫向視圖。它可以正常工作,直到新的iOS 6發佈。iOS 6方向問題
我真的不明白iOS 6中的方向如何工作。於是我寫了一個測試應用程序。這是我做的:
- 設置應用程序的方向以支持所有的方向。
- 我用故事板。 rootViewController嵌入在縱向的UINavigationController中。
在RootViewController的代碼:
- (NSUInteger)supportedInterfaceOrientations
{
回報UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown;
}
當我點擊打開欄按鈕,我會推這應該是在風景模式另一個(SecondViewController)視圖控制器:
- (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight; }
雖然此方法調用正確,但第二個視圖控制器始終也處於縱向模式。
有人可以給我一些建議嗎?由於
看看這有助於:http://stackoverflow.com/questions/12519693/unable-to-handle-orientation-in-ios-6 –