I am having strange problems presenting modal views from landscape orientation. The problem can be recreated by simply starting with a new view-based application and doing the following:
Create a new
UIViewController
subclass that will be presented. I named mineModalViewController
. Change the views background color to make the bug more noticeable.return YES;
in both controllersshouldAutorotateToInterfaceOrientation:
Add an
IBAction
to your main view to display the modal and hook this action up to a button in your main view controller.- (IBAction)showModal { ModalViewController *vc = [[ModalViewController alloc] initWithNibName:@"ModalViewController" bundle:nil]; [self presentModalViewController:vc animated:NO]; [vc release]; }
Now when you click the button from landscape mode you should see the problem. The entire view is shifted up and to the left.
Anyone else experiencing this problem or have any workarounds? I am having similar problems on the iPad.