I have read several other questions (and answers) regarding the same issue, but could not find a single working solution for my case.
I am developing an iOS app for iOS7 using Storyboards. This app is composed by multiple UIViewControllers. All of them but one MUST be displayed only with the Portrait interface orientation. My problem is that all the views rotate when they should not.
In the XCode project settings I tick the Portrait
and Landscape Left
device orientations.
The related Apple docs are available at the following URLs: Controlling What Interface Orientations Are Supported (iOS 6), supportedInterfaceOrientations and preferredInterfaceOrientationForPresentation.
I added to all the UIViewControllers
in the Storyboad
(but the one that can rotate) the following methods:
- (BOOL) shouldAutorotate {
return YES;
}
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return UIInterfaceOrientationPortrait;
}
Unfortunately all the views rotate to landscape left position. Why?