UIDeviceOrientation ori = [UIDevice currentDevice].orientation; // e.g. UIDeviceOrientationPortrait
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
};
本文介绍了UIDevice类的基本用法及属性获取方式,如设备名称、系统名称与版本、设备型号等,并展示了如何获取设备的物理方向。
875

被折叠的 条评论
为什么被折叠?



