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

标签 ios objective-c ipad xcode4.5

我在 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/

相关文章:

iphone - 我如何为 iphone 3.5 和 iphone 4 英寸屏幕(ios 6 和 ios 7)设计 Single xib?

ios - QuickBlox Opponent 视频和音频流不来?

ios - 如何将照片显示到另一个 UIViewController 中

ios - 具有动态单元格高度的 UITableview 中的自动布局

objective-c - 使用 NSTask 运行 shell 脚本会导致 posix_spawn 错误

objective-c - iPad 应用程序仅在设备上而非模拟器上加载 Nib 时崩溃

iPhone 应用程序 - 复制并粘贴一个类,现在一切都出错了

iOS - 同时运行多个异步请求

objective-c - 无法从自定义类获取数据

iOS - Objective C - 无法使用 UInt8 渲染像素