我在 AppStore 上有一个应用程序,它在 iPhone 上有纵向模式,在 iPad 上它可以横向运行。但是我收到报告说它在 iPad 1 上显示肖像因此破坏了整体 View 。
为什么 iPad 1 专门显示人像模式? iPad版本为5.1.1
最佳答案
在 ios 6 中,支持界面方向的方法已经改变。为了在两个版本中都支持两种界面方向,我们需要检查操作系统版本并协调编写代码。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
支持新版本
- (NSUInteger)supportedInterfaceOrientations {
}
- (BOOL)shouldAutorotate {
}
在我的 View Controller 中,我有以下内容:
- (NSUInteger)supportedInterfaceOrientations {
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
}
- (BOOL)shouldAutorotate {
}
关于ios - iPad 1 显示纵向模式而不是横向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19164457/