Search code examples
ios6orientationlandscape-portraitautorotate

iOS 6: Unable to force portrait mode generally and landscape mode in one single view


I am searching the whole net for days, but can't find an answer.

The problem is: I can't force my app to present ALL UIViewControllers just in portrait mode, except one UIViewController, which should be able to work in every of the 4 modes.

Those are my options:

  • iOS 6
  • UINavigationController
  • UITabBarController
  • Storyboard
  • All modes are enabled in the project (also in Info.plist)

I already tried

- (BOOL)shouldAutorotate {
    return YES;
}

- (NSUInteger)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskPortrait;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

but it does not even seem to work..

Any idea?


Solution

  • Found the answer:

    That's it :).