I'm building an application that supports only Landscape orientation on the iPad under iOS 4.3, though the bug was present under iOS 4.2 as well.
Several places in the application, I am showing UIViewController
s as modal views. All of them are shown using this pattern:
viewController.modalPresentationStyle = UIModalPresentationFormSheet;
viewController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentModalViewController:viewController animated:YES];
In most places, they work as expected - the modal form sheet slides in from the bottom of the screen upward.
However, in two cases, the modal form sheet slides in from the bottom left of the screen. The form sheet slides nearly all the way to the right with the bottom of the form sheet out of view. If you focus a text field and show the onscreen keyboard, the form sheet moves to the top center of the screen where you would expect it to be.
I don't think the Simulated Metrics of the XIBs affect their behaviour, but I have set the orientation for all of them (both the calling UIViewController
self
and the modal view controller viewController
) to Landscape.
Any ideas why these two modal form sheets are behaving differently from the others?
Make sure if you have a viewController embedded in a NavigationController that the navController shouldAutotorate is also set to landscape