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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T21:57:44+00:00 2026-05-14T21:57:44+00:00

I have a tab bar application that contains navigation views in 2 of its

  • 0

I have a tab bar application that contains navigation views in 2 of its tabs. I would like 1 view in the 1 navigation controller to allow landscape view but because of the nav bar in tab bar limitation I now have to allow landscape views for every single view in my app to make the tilt messages get passed to my app which I don’t want.

I thought perhaps, on the views which shouldn’t go to landscape, that there might be ways to either:
prevent the view change e.g. calling setOrientation:UIDeviceOrientationPortrait whenever the device goes landscape
or
giving the illusion that the view doesn’t change e.g. presenting a modal portrait view over the rotated view

Anybody have any ideas or experience that they care to share? What is the best approach here? (I don’t want to now have to design a landscape view for every view just to so that I can display a portrait & landscape view for 1 view)

  • 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-05-14T21:57:45+00:00Added an answer on May 14, 2026 at 9:57 pm

    I had to deal with the same problem recently and my solution is as follows:

    within the UIViewController of the View that you want to be able to rotate add a Notification Handler for the UIDeviceOrientationDidChangeNotification

    -(void)viewDidLoad {
    
    
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(didRotateFromInterfaceOrientation)
                                                 name:@"UIDeviceOrientationDidChangeNotification" object:nil];
    

    }

    then of course you need to implement your didRotateFromInterfaceOrientation Method.

    within that Method you can get the current orientation using

     UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
    

    what I did next was evaluation the view i want to display, based on the orientation

    switch (orientation) {
        case UIDeviceOrientationLandscapeLeft:
            NSLog(@"UIDeviceOrientationLandscapeLeft");
            [self presentModalViewController:LandscapeView animated:YES];
    
            break;
        case UIDeviceOrientationLandscapeRight:
            NSLog(@"UIDeviceOrientationLandscapeRight");
    
            [self presentModalViewController:LandscapeView animated:YES];
    
            break;
        case UIDeviceOrientationPortraitUpsideDown:
            NSLog(@"UIDeviceOrientationPortraitUpsideDown");
            [LandScapeview dismissModalViewControllerAnimated:YES];
    
            break;
        case UIDeviceOrientationPortrait:
            NSLog(@"UIDeviceOrientationPortrait");
            [LandscapeView dismissModalViewControllerAnimated:YES];
            break;
    
        case UIDeviceOrientationFaceUp:
            NSLog(@"UIDeviceOrientationFaceUp");
    
            break;
    
        case UIDeviceOrientationFaceDown:
            NSLog(@"UIDeviceOrientationFaceDown");
            break;
    
        default:
            break;
        }
    }
    

    I hope i could help a bit.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a tab-bar and navigation controller application (like Youtube app or Contacts app).
I have an application with a tab bar controller and each view contains a
I have an application that has many views (Using tab bar controller). I want
So I have an application that embeds a Navigation Controller inside a Tab Bar
I have a tab bar application. Each tab contains navigation controller allowing the user
Within my iPhone application I have a common tab bar with three tabs that
I have a tab bar along with navigation controller iphone application. Now I need
I have an application set up where the window contains a tab bar controller
I have a tab bar controller application that allows for anonymous access however one
I have a table view in an iPhone xcode tab bar application that shows

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.