【发布时间】:2011-06-09 02:22:42
【问题描述】:
嘿,这是我正在使用的代码
switch ([[UIDevice currentDevice] orientation])
{
case UIInterfaceOrientationPortrait:
[self displayActionSheetInPotraitMode];
break;
case UIInterfaceOrientationLandscapeLeft:
case UIInterfaceOrientationLandscapeRight:
[self displayActionSheetInLandscapeMode];
break;
default:
break;
}
但是当我在设备上的 iOS 版本 4 或 4.1 中尝试时
switch ([[UIDevice currentDevice] 方向])
没有返回正确的值。我的应用程序将在 IOS 4 及更高版本中运行。我该如何纠正这个问题?
【问题讨论】:
标签: iphone