UIDeviceOrientationDidChangeNotification与UIApplicationDidChangeStatusBarOrientationNotification

时间:2016-08-08 20:55:19

标签: objective-c notifications uiapplication uideviceorientation

两者之间有什么区别?在哪种情况下,我应该使用哪一种?

1 个答案:

答案 0 :(得分:0)

typedef NS_ENUM(NSInteger, UIInterfaceOrientation) {
UIInterfaceOrientationUnknown            = UIDeviceOrientationUnknown,
UIInterfaceOrientationPortrait           = UIDeviceOrientationPortrait,
UIInterfaceOrientationPortraitUpsideDown = UIDeviceOrientationPortraitUpsideDown,
UIInterfaceOrientationLandscapeLeft      = UIDeviceOrientationLandscapeRight,
UIInterfaceOrientationLandscapeRight     = UIDeviceOrientationLandscapeLeft

}

从上面看,UIInterfaceOrientationLandscapeLeft的差异等于UIDeviceOrientationLandscapeRight,UIInterfaceOrientationLandscapeRight等于UIDeviceOrientationLandscapeLeft。 当设备landscapeLeft时,界面应向右旋转以保持内容不反转。