我为 iPhone 和 iPad 开发了一个通用应用程序。使用 Targets 中的“支持的界面方向”选项(在 Xcode 项目中),我设置了所需的配置,一个用于 iPhone,另一个用于 iPad。iPhone(5.1 和 6.1)没有问题,但在 iPad 上,我看到 5.1 固件中的方向不正确(不像之前写的那样设置)。对于装有 iOS 6.1 的 iPad,该应用程序可以正常工作。
我已经阅读了另一个 stackoverflow 的问题,有一个解决方案:引入以下代码,问题将是正确的。
-(NSInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationLandscapeRight;
}
// pre-iOS 6 support
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
return UIInterfaceOrientationLandscapeRight;
}
就我而言,问题仍然存在。我能怎么做?