在 iOS 8 中,他们添加了设备方向检测(在此处UIInterfaceOrientationUnknown
查看预发布文档)
UIInterfaceOrientationUnknown
无法确定设备的方向。
在 iOS 8.0 及更高版本中可用。
typedef enum : NSInteger {
UIInterfaceOrientationUnknown = UIDeviceOrientationUnknown,
UIInterfaceOrientationPortrait = UIDeviceOrientationPortrait,
UIInterfaceOrientationPortraitUpsideDown = UIDeviceOrientationPortraitUpsideDown,
UIInterfaceOrientationLandscapeLeft = UIDeviceOrientationLandscapeRight,
UIInterfaceOrientationLandscapeRight = UIDeviceOrientationLandscapeLeft
} UIInterfaceOrientation;
在我看来,该设备可能只有 4 种方式Portrait
,UpsideDown
和。那么在什么情况下你会遇到未知的设备方向?LandscapeRight
LandscapeLeft