I want to only support landscape mode in my application. I have set the following:
- Orientation for all view controllers in the application are set to Landscape. Some of the view controllers are in a storyboard while couple are not
- The
shouldAutorotateToInterfaceOrientation
method for all viewControllers are set to return TRUE for LandscapeLeft and LandscapeRight orientations and FALSE otherwise - Supported orientation in info.plist is set to landscape as well
Now when I run the application everything works as expected and the app starts in landscape model.
However under some conditions I have to throw a modal at the start of the application.
I open the model from the rootviewcontroller
of my UINavigationController
with the following code:
AskInfoViewController *askInfo = [[AskInfoViewController alloc] init];
[askInfo setModalPresentationStyle:UIModalPresentationFormSheet];
[askInfo setModalTransitionStyle:UIModalTransitionStyleCrossDissolve];
[self presentModalViewController:askInfo animated:YES];
In these situations, the modal opens just fine but the background of the modal is in portrait mode.
Any idea how I can ensure that all views in my app are always in landscape model with or without the modal?