portrait:
portrait原意是肖像画,因为肖像画要竖着挂,所以portrait代表手机竖放。
Landscape原意是风景画,风景画一般是横着挂,所以Landscape代表手机横放。
意思是:device在Portrait状态下, 向左转。所以home button就在右边了。
UIInterfaceOrientationLandscapeRight = UIDeviceOrientationLandscapeLeft
是因为设备向左转后,显示内容要正常显示,就需要向右转才可以。
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
};
以及如下四种界面方向:
typedef NS_ENUM(NSInteger, UIInterfaceOrientation) {UIInterfaceOrientationPortrait = UIDeviceOrientationPortrait,
UIInterfaceOrientationPortraitUpsideDown = UIDeviceOrientationPortraitUpsideDown,
UIInterfaceOrientationLandscapeLeft = UIDeviceOrientationLandscapeRight,
UIInterfaceOrientationLandscapeRight = UIDeviceOrientationLandscapeLeft
};