2012-12-03 51 views
0

我已經編程創建了所有的視圖,沒有任何與IB。我的視圖包含導航控制器,表格視圖,按鈕,標籤欄。現在我應該怎麼做我的應用程序,支持所有的方向爲iOS 5和iOS 6支持所有的方向xcode

+1

經過以下幾個環節 http://stackoverflow.com/questions/11621777/how-to-properly-設計多方位用的iPad應用程序 –

回答

0

寫在你的所有UIViewController -s:

- (NSInteger)supportedInterfaceOrientations { 
    return UIInterfaceOrientationMaskAll; 
} 
- (BOOL)shouldAutorotate { 
    return YES; 
} 
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { 
    return YES; 
} 
0

你有沒有嘗試設置在摘要窗格支持的設備取向項目的目標如附圖所示?

enter image description here

0

這在iOS 6中被改變:

- (NSInteger)supportedInterfaceOrientations 
{ 
    return UIInterfaceOrientationMaskAll; 
}