Presenting UIModalViews in landscape mode

1.5k views Asked by At

I'm trying to present some UIModalFormSheets in a my iPad application. It's working without any problems, except one thing:

When I have my iPad in landscape mode my modal form sheet is moving to the center of the screen and then rotates into the appropiate angle. All I want is to present the modal form sheet in the right angle according to the view mode (portrait or landscape), before it is displayed, so that the user doesn't see this rotation.

I have tried all the modes for modalTransitionStyle and modalPresentationStyle, but nothing seems to prevent the modal form sheet from rotating after it is displayed.

This is what I'm doing:

NewFavouriteSheet *newFavouriteSheet = [[NewFavouriteSheet alloc] 
                 initWithNibName:@"NewFavouriteSheet" bundle:nil];
newFavouriteSheet.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentModalViewController:newFavouriteSheet animated:NO];

Does anyone has a suggestion on how to show the modal view in a correct way?

Thanks for your help.

1

There are 1 answers

0
Alex On

Make sure every view controller in your modal sheet responds appropriately to shouldAutorotateToUserInterfaceOrientation: for the landscape orientations.