Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8646841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:55:02+00:00 2026-06-12T12:55:02+00:00

I only want to support different Orientations on one View in my UINavigationController Stack.

  • 0

I only want to support different Orientations on one View in my UINavigationController Stack. How can I do this?

It also has to work in iOS5.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T12:55:03+00:00Added an answer on June 12, 2026 at 12:55 pm

    I’ve had a lot of trouble with how iOS6 handles Orientation, hopefully this is what you’re looking for.

    Create a category of UINavigationController and call it “UINavigationController+autoRotate”.

    Put this in your UINavigationController+autoRotate.h:

    #import <UIKit/UIKit.h>
    
    @interface UINavigationController (autoRotate)
    
    -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation;
    -(BOOL)shouldAutorotate;
    - (NSUInteger)supportedInterfaceOrientations;
    
    @end
    

    Put this in UINavigationController+autoRotate.m:

    #import "UINavigationController+autoRotate.h"
    
    @implementation UINavigationController (autoRotate)
    
    -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    {
        return [self.topViewController shouldAutorotateToInterfaceOrientation:interfaceOrientation];
    }
    
    - (BOOL)shouldAutorotate
    {
        return [self.visibleViewController shouldAutorotate];
    }
    
    
    - (NSUInteger)supportedInterfaceOrientations
    {
        if (![[self.viewControllers lastObject] isKindOfClass:NSClassFromString(@"ViewController")])
        {
            return UIInterfaceOrientationMaskAllButUpsideDown;
        }
        else
        {
            return [self.topViewController supportedInterfaceOrientations];
        }
    }
    
    @end
    

    For Views that you DO NOT want to rotate, add:

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    {
        return (interfaceOrientation == UIInterfaceOrientationPortrait);
    }
    
    - (NSUInteger)supportedInterfaceOrientations
    {
        return UIInterfaceOrientationMaskPortrait;
    }
    
    - (BOOL)shouldAutorotate
    {
        return NO;
    }
    

    And for Views you DO want to rotate:

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    {
        return (interfaceOrientation != UIDeviceOrientationPortraitUpsideDown);
    }
    
    - (NSUInteger)supportedInterfaceOrientations
    {
        return UIInterfaceOrientationMaskAllButUpsideDown;
    }
    
    - (BOOL)shouldAutorotate
    {
        return YES;
    }
    

    In your App’s delegate, add:

    - (NSUInteger)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window
    {
        return UIInterfaceOrientationMaskAllButUpsideDown;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say that I want to build 2 different sets of tablet-only layouts. One
I only want this function to run if .toolbar li does not have the
We only want one instance of our app running at any one time. So
I want to insert in Different tables with only single FORALL Loop in oracle.but
I want to make a CSS only speech bubble. So far, I have this...
Distributing ASP.NET user controls across different projects can be really useful when you want
I want to write several functions that are only different in the types of
I want to implement a rather complex CurveEditor that has to support the usual
Now mex in MATLAB 2012a only officially supports gcc 4.4.6 but I want to
I only want to show my title attribute in some cases. I don't want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.