UIDeviceOrientation的定义如下:
typedef NS_ENUM(NSInteger, UIDeviceOrientation) {
UIDeviceOrientationUnknown,
UIDeviceOrientationPortrait, // Device oriented vertically, home button on the bottom
UIDeviceOrientationPortraitUpsideDown, // Device oriented vertically, home button on the top
UIDeviceOrientationLandscapeLeft, // Device oriented horizontally, home button on the right
UIDeviceOrientationLandscapeRight, // Device oriented horizontally, home button on the left
UIDeviceOrientationFaceUp, // Device oriented flat, face up
UIDeviceOrientationFaceDown // Device oriented flat, face down
};UIDeviceOrientation
其后的注释说明 home button的方向,很让我头晕了一阵。
后来发现UIDeviceOrientation指的是手机头朝哪儿,这么理解就很好理解了。
UIDeviceOrientationPortraitUpsideDown 是指头朝上。
UIDeviceOrientationLandscapeLeft是指头朝下左。
UIDeviceOrientationFaceUp是另一个系统了,不在上面的理解方法的范围内了。