2013-02-27 169 views
3

事實:iPhone應用程序在橫向模式下打開iPad上

開發了iPhone應用程序,這是一般的旋轉,但每個單獨的看法是不旋轉的。我們只需要一個顯式視圖中的旋轉特徵,所以我們必須通常啓用旋轉。

現在,當您在iPad上安裝應用程序並以橫向模式打開應用程序時,應用程序將以橫向模式顯示,並且如果您打開iPad,則不能將其旋轉回縱向(這似乎是邏輯上的,因爲旋轉不是允許在視圖中)。

我不會遇到在模擬器:(

任何人的想法做什麼?對不起,不包括代碼...

+0

檢查您的.plist並設置所有的取向性。 – 2013-02-27 15:10:30

+0

默認情況下iPhone應用程序在縱向啓動,但在iPad風景和人像啓動畫面支持,可能是因爲它。 – 2013-02-27 16:02:54

回答

2

嘗試增加「支持的接口方向(新iPad)」,並確保「人像底部主頁按鈕」是列表中的第一此外,修改你的根視圖控制器,使其只在畫像顯示出來

+0

似乎這工作得很好。謝謝。 – pebbo 2013-02-27 15:25:25

+0

這不適合我..我添加了「支持的界面方向(iPad)」,並確保「肖像底部主頁按鈕」是列表中的第一個,我還將函數「shouldAutorotate」添加到我的根視圖控制器。有什麼想法嗎? – 2014-03-31 21:32:15

0

除了邁克·中號的回答,我有這樣的MI RootViewController的:。

的Objective-C

- (BOOL)shouldAutorotate { 
    return NO; 
} 

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { 
    return UIInterfaceOrientationPortrait; 
} 

- (UIInterfaceOrientationMask)supportedInterfaceOrientations { 
    return UIInterfaceOrientationMaskPortrait; 
} 

斯威夫特

override func preferredInterfaceOrientationForPresentation() -> UIInterfaceOrientation { 
    return UIInterfaceOrientation.Portrait 
} 

override func shouldAutorotate() -> Bool { 
    return false 
} 

override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask { 
    return UIInterfaceOrientationMask.Portrait 
} 
相關問題