The Idea behind the UIInterfaceOrientaitonLandscapeRight-Left
I'm very curious about why UIIntefarceOrientation value equals to -LandscapeRight when I rotate the phone t开发者_C百科o left and vice-versa.Here's the -LandscapeRight mode:
and here's the -LandscapeLeft mode:
Roughly said, before, when the phone was in -Portrait mode the speaker or the top of the phone was pointing up, now it's poiting to left. But why is it -LanscapeRight?
It simply means the user interface has rotated to the right, not the device. Imagine the device still (always pointing upwards) the interface would rotate.
it's all comes from the home button of iphone wheter it will be the position will be according to its home button position like in your upper image the home button on right side os the position is uiinterfaceorientationright and next one is left .
To quote the XCode documentation:
UIInterfaceOrientationLandscapeLeft
The device is in landscape mode, with the device held upright and the home button on the left side. Available in iOS 2.0 and later.
Declared in UIApplication.h.
UIInterfaceOrientationLandscapeRight The device is in landscape mode, with the device held upright and the home button on the right side. Available in iOS 2.0 and later. Declared in UIApplication.h.
I thought I'd post my own answer as I understood it totally .As @Magic Bullet Dave said it's the Interface orientation of which is changing according to the device itself. If we take the device and the interface separately, when we rotate the device itself to left then the interface orientation will remain right to the device. So as the name implies it is UIInterfaceOrientationLandscapeRight not UIDeviceOrientationLadscapeRight.
精彩评论