【发布时间】:2012-12-12 09:17:58
【问题描述】:
我有一个通用应用程序。我希望我的应用可以在 iPhone 的两种方向模式下工作,但仅适用于 iPad 的纵向模式,
如何做到这一点?
setOrientationtion 在 iOS5 中没有响应。
【问题讨论】:
标签: iphone ios ipad uiinterfaceorientation
我有一个通用应用程序。我希望我的应用可以在 iPhone 的两种方向模式下工作,但仅适用于 iPad 的纵向模式,
如何做到这一点?
setOrientationtion 在 iOS5 中没有响应。
【问题讨论】:
标签: iphone ios ipad uiinterfaceorientation
【讨论】:
这将对您有所帮助:
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
// The device is an iPad running iPhone 3.2 or later.
// Rotate to landscape
}
else {
// The device is an iPhone or iPod touch.
// Rotate to portrait
}
【讨论】:
您可以在 Xcode 的项目设置编辑器中为每个设备设置方向。
【讨论】:
试试 ios5 及之前的 shouldAutorotateToInterfaceOrientation: 方法。
【讨论】: