2013-02-27 172 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 
} 
相关问题