3

I have an app with one NavigationController and 4 UIViewController. I like to have 3 UIViewController in UIInterfaceOrientationPortrait and one in the Landscape mode. The Landscape Orientation should appear immediately, when the view appears. Unfortunately, the mode changes only when I turn the device. What can I do to change immediately to landscape without rotate the device?

Here is the code for my NavigationController.m

-(NSUInteger)supportedInterfaceOrientations
{
    return [self.topViewController supportedInterfaceOrientations];
}



- (BOOL)shouldAutorotate
{
    return [self.topViewController shouldAutorotate];
}

This is for the Portrait UIViewcontroller.m

- (NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskPortrait;
}

And for the Landscape UIViewController.m :

- (NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskLandscapeRight;
}


- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
    //  (iOS 6)
    //  Force to portrait
    return UIInterfaceOrientationLandscapeRight;
}

In advance thanks for your help!

rmaddy
  • 314,917
  • 42
  • 532
  • 579
user1355961
  • 51
  • 1
  • 8
  • I have exactly the same problem. Perhaps we have to implement the navigation controller delegate in the navigation controller subclass and do something in willShowViewController or didShowViewController, like re-layout or re-rotate. Don't know. Do you have any progress? Thanks a lot. – Ricardo Oct 18 '13 at 08:29
  • I'm asking this question in Apple forums: http://stackoverflow.com/questions/19119603/change-uiinterfaceorientation-for-only-one-uiviewcontroller – Ricardo Oct 21 '13 at 16:36

0 Answers0