Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Add new Objective-C class (subclass of UINavigationController) and add the following code to the .m files</p> <pre><code>-(NSUInteger)supportedInterfaceOrientations { NSLog(@"supportedInterfaceOrientations = %d ", [self.topViewController supportedInterfaceOrientations]); return [self.topViewController supportedInterfaceOrientations]; } -(BOOL)shouldAutorotate { return self.topViewController.shouldAutorotate; } -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // You do not need this method if you are not supporting earlier iOS Versions return [self.topViewController shouldAutorotateToInterfaceOrientation:interfaceOrientation]; } </code></pre> <p>After you added the new classes go to your ViewController classes and make the following changes </p> <pre><code>- (BOOL)shouldAutorotate // iOS 6 autorotation fix { return YES; } - (NSUInteger)supportedInterfaceOrientations // iOS 6 autorotation fix { return UIInterfaceOrientationMaskAll; } - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation // iOS 6 autorotation fix { return UIInterfaceOrientationPortrait; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { return YES; } </code></pre> <p><img src="https://i.stack.imgur.com/AbXIG.png" alt="enter image description here"></p> <p>In the shouldAutorotate , shouldAutorotateToInterfaceOrientation: return YES if you want the ViewController to be supporting Multiple orientation else return NO , also in houldAutorotateToInterfaceOrientation: method pass the Orintation you want for that specific ViewController , Repeat the same for all the view controllers . </p> <p>Reason of doing this:-</p> <p>1:Although you can change the preferredInterfaceOrientationForPresentation: of any viewController to a specific orientation but since you are using the UINavigationController you also need to override the supportedInterfaceOrientations for your UINavigationController</p> <p>2:In order the override the supportedInterfaceOrientations for UINavigationController we have subclassed UINavigationController and modified the method related to the UINavigation Orientation. </p> <p>Hope it will help you !</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload