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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:10:09+00:00 2026-06-05T15:10:09+00:00

So my iPhone application currently has a tabviewcontroller that populates the entire screen. The

  • 0

So my iPhone application currently has a tabviewcontroller that populates the entire screen. The app only runs in portrait mode. My task has been to detect device orientation changes, and once it changes to landscape, have a new uiview populate the entire screen.

I already have the device orientation change detection working. I’ve used an NSNotificationCenter to successfully call a helper method, deviceOrientationChanged, once an orientation change is detected. IF the change was to landscape mode, I run a certain block of code.

In this block of code I have already tried various things, none of which are successful. Simply saying self.view = newViewThing; does not work because the statusbar is still present at the top and the tabs are still present at the bottom.
I have also tried adding this newViewThing as a subview to the UIWindow. This did not work because while the view was added, it was not oriented correctly.

THE QUESTION IS: is there a way to load an entirely new uiview once a device orientation change is detected? Thank you in advance.

  • 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-05T15:10:10+00:00Added an answer on June 5, 2026 at 3:10 pm

    Yes, there is a way to load a new view. I make it in my app that way:

    - (void)orientationChanged:(NSNotification *)notification
    {
        // We must add a delay here, otherwise we'll swap in the new view
        // too quickly and we'll get an animation glitch
        [self performSelector:@selector(updateLandscapeView) withObject:nil afterDelay:0];
    }
    
    - (void)updateLandscapeView
    {
        UIDeviceOrientation deviceOrientation = [UIDevice currentDevice].orientation;
        if (UIDeviceOrientationIsLandscape(deviceOrientation) && !isShowingLandscapeView)
        {
            [self presentModalViewController:self.landscapeView animated:YES];
            isShowingLandscapeView = YES;
        }
        else if (deviceOrientation == UIDeviceOrientationPortrait && isShowingLandscapeView)
        {
            [self dismissModalViewControllerAnimated:YES];
            isShowingLandscapeView = NO;
        }    
    }
    

    And also I have added this code to viewDidLoad:

    [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged:)
                                                 name:UIDeviceOrientationDidChangeNotification object:nil];
    

    and this code to dealloc:

    [[NSNotificationCenter defaultCenter] removeObserver:self];
    [[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently working on an Iphone application that has 3 text fields. If I
I currently have a simple iPhone app that loads a custom subclass of UIView.
I am currently developing a charting application (for the iPhone, although that is largely
I am currently creating an application (iPhone/iPad/Android) that uses a map to display houses
i'm currently working on iphone app which has a web view. i'm pulling a
I'm developing a web application that also has a mobile webapp. I currently use
I currently have an iPhone application with a tabbar and multiple viewcontrollers. All the
I'm currently developing a simple iPhone application using a UITabBar and table views for
I'am currently migrating an iphone application using SQLite to CoreData. I need to do
I'm currently developing an iPhone application, and when it comes to compiling, I have

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.