The documentation says:
UIInterfaceOrientationLandscapeLeft
The device is in landscape mode, with the device held upright and the home button on the right side.
UIInterfaceOrientationLandscapeRight
The device is in landscape mode, with the device held upright and the home button on the left side.
However, I'm getting them exactly reversed. Can there really be such a mistake in the SDK, or am I just going crazy?
Code:
+ (NSString *)NSStringFromUIInterfaceOrientation:(UIInterfaceOrientation)o
{
switch (o) {
case UIInterfaceOrientationPortrait: return @"UIInterfaceOrientationPortrait";
case UIInterfaceOrientationPortraitUpsideDown: return @"UIInterfaceOrientationPortraitUpsideDown";
case UIInterfaceOrientationLandscapeLeft: return @"UIInterfaceOrientationLandscapeLeft";
case UIInterfaceOrientationLandscapeRight: return @"UIInterfaceOrientationLandscapeRight";
}
return nil;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
NSLog(@"Should: %@", [[self class] NSStringFromUIInterfaceOrientation:toInterfaceOrientation]);
return YES;
}
I paste the above code in RootViewController.m of the default Navigation-based app template.
Follow-up: Reported as bug 7216046.
Are you sure you're reading the docs correctly? Notice that the home button position and the orientation value are opposites - that is, UIInterfaceOrientationLandscapeLeft
implies the home button on the right side, and UIInterfaceOrientationLandscapeRight
implies the home button on the left side. Make sure you're rotating your device to check properly.
Edit: I've confirmed the issue presented in the original question. Looks like a bug, unless I'm missing something too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With