Presenting UIModalViews in Landscap mode

Posted by Dominik on Stack Overflow See other posts from Stack Overflow or by Dominik
Published on 2010-05-31T18:32:53Z Indexed on 2010/06/01 14:13 UTC
Read the original article Hit count: 321

Hello,

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 help.

Dominik

© Stack Overflow or respective owner

Related posts about cocoa

Related posts about modal-dialog