views:

41

answers:

1

I have a iphone app where I want to present one of the views modally in landscape mode only and have set the code below its view controller. All works fine on the iphone (its intended platform), but when run on the iPad for demonstration, the left hand edge of the landscape view is truncated by approx 10 pixels. i.e. it looks like the display is too wide for the screen. No other views are affected and the same thing happens at 1x or 2x zoom.

Is this a bug or have I missed something?

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
A: 

InterfaceOrientation can return "unknown" value, in these cases you can encounter the case that the iPad thinks it is rotated and your code will return the wrong result

Guy Ephraim
Thanks for responding Guy. I have not implemented any code for changes to orientation. All my views are set to AutoSize and I am simply relying on the framework to do the rotation.
Bruce Alport
in the code you wrote, you are referencing "interfaceOrientation == UIInterfaceOrientationLandscapeRight" however interfaceOrientation can be unknown while being in landscape mode
Guy Ephraim