I've got a main view controller that is in landscape (the whole app is landscape left/right).
That main view presents a modal view using:
ModalViewController *modalVC = [[ModalViewController alloc] init];
[modalVC setModalTransitionStyle:UIModalTransitionStyleCrossDissolve];
[self presentModalViewController:modalVC animated:YES];
In iOS 5.0*, this works exactly as I would expect, the main view is in landscape and the modal view appears in landscape.
In iOS 5.1, the main view instantly rotates 90º to the left and the modal view then appears also rotated 90º and cropped. When the modal view is dismissed, the main view comes back and is normal and in landscape.
I've tried all kinds of mutations of the shouldAutorotateToInterfaceOrientation and it has no effect. I've left it like this for now:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight) || (interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
I just can't figure this out, never had an issue until I just put iOS 5.1 on my iPhone and ran the app for the first time on it.
Thanks in advance!
*This is confirmed using the 5.0 and 5.1 iPhone simulators