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 8939613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:51:37+00:00 2026-06-15T10:51:37+00:00

I want all my views to be in Portrait mode. This works except when

  • 0

I want all my views to be in Portrait mode. This works except when I push a UINavigationController onto another one. In this case the views inside the secondaryNavigationController will adhere to device orientation instead. Here is how I’m calling the UINavigationControllers.

[secondaryNavigationController setNavigationBarHidden:YES];
[[appDelegate secondaryNavigationController navigationBar] setHidden:YES];
[mainNavigationController presentModalViewController:[appDelegate secondaryNavigationController] animated:YES];

All my views implement this method but it doesn’t seem to help.

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
  • 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-15T10:51:38+00:00Added an answer on June 15, 2026 at 10:51 am

    Here is the full answer that worked for me, building off of iYaniv’s comment and Jacky Boy’s answer.

    I took iYaniv’s category and made it a subclass of UINavigationController instead of a category (which is what you should do). Then I replaced all instances of UINavigationController * with myUINavigationController *. Then used Jacky Boy’s snippet in all of my UIViewControllers.

    /* myUINavigationController.h */
    
    #import <UIKit/UIKit.h>
    
    @interface myUINavigationController : UINavigationController
    
    @end
    

    and

    /* myUINavigationController.m */
    
    #import "myUINavigationController.h"
    
    @interface myUINavigationController ()
    
    @end
    
    @implementation myUINavigationController
    
    -(BOOL)shouldAutorotate
    {
        return [[self.viewControllers lastObject] shouldAutorotate];
    }
    
    -(NSUInteger)supportedInterfaceOrientations
    {
        return [[self.viewControllers lastObject] supportedInterfaceOrientations];
    }
    
    - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
    {
        return [[self.viewControllers lastObject] preferredInterfaceOrientationForPresentation];
    }
    
    @end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want all view controllers to support only portrait mode, except one view controller
All I want to do is include this: @using MyProject.WebUI.Properties Across all my views
I want all the views of Row in OnListItemClick() Actually I want to change
I have several UILabels of various sizes on my Views. I want all the
I want all labels inside a detail view to be bold. I created a
on one of my web pages I want my manager user to view all
I have the following class that extends Backbone.View, I want all my backbone views
I want to change first view in portrait mode and the second view comes
I want to rotate ONLY one of my views within my app to either
My iPhone app is all in portrait mode at the moment. But I need

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.