iPad 1显示纵向模式而不是横向

Muh*_*mar 4 objective-c ipad ios xcode4.5

我在AppStore上有一个应用程序,它在iPhone上有纵向模式,在iPad上可以在横向上运行.然而,我得到的报告显示它在iPad 1上显示肖像因此破坏了整体视图.

为什么iPad 1专门显示人像模式?iPad的版本是5.1.1

iGo*_*iGo 6

在ios 6中,支持界面方向的方法已经改变.为了支持两个版本中的接口方向,我们需要检查os版本并相应地编写代码.

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationPortrait); 
}
Run Code Online (Sandbox Code Playgroud)

支持新版本

- (NSUInteger)supportedInterfaceOrientations {

}

- (BOOL)shouldAutorotate {
   }
Run Code Online (Sandbox Code Playgroud)

在我的View Controller中,我有以下内容:

- (NSUInteger)supportedInterfaceOrientations {

}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {

}

- (BOOL)shouldAutorotate {

} 
Run Code Online (Sandbox Code Playgroud)