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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:47:02+00:00 2026-05-22T16:47:02+00:00

In my application I use an Alternate Landscape Interface strategy (present your landscape view

  • 0

In my application I use an Alternate Landscape Interface strategy (present your landscape view as a modal). I also use a navigation controller for transitioning and this causes the following problem: I dunno how to push/pop correctly from landscape orientation.

I came up with the following solution, but someone may know a better one. Suppose one has to deal with only two views. Let’s call them AP, AL, BP, BL, where the second letter stands for orientation. We start with a navigation controller with AP inside. To go between AP and BP we just push/pop. To go from AP to AL we present a modal navigation controller with AL inside. To go between AL and BL we push/pop inside the second navigation controller. Now to go from BP to BL we pop w/o animation and present a modal navigation controller with BL sitting on top of AL. To go from BL to BP we dismiss the modal navigation controller and push BP w/o animation.

Seems to be a bit ugly, but not so bad. Can anyone think of something better?

Thanks 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-05-22T16:47:02+00:00Added an answer on May 22, 2026 at 4:47 pm

    Is there some reason you need to present your landscape orientation as modal in a separate controller? When I have two entirely different views for my portrait and landscape orientations I fade between them as they stretch during the rotation.

    This allows for vastly different content in both orientations, a nice transition between them, and shared code under one controller.

    Here is some code. Our UIViewController will switch between portraitView and landscapeView when we change orientation.

    portraitView and landscapeView are both children of the UIViewController’s view. The hierarchy looks as follows:

    UIViewController
        |
         - view
            |
            |- portraitView
            |
            |- landscapeView
    

    Both have their autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight to ensure that they stretch as the view controller rotates.

    - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
    {
        if( orientation == UIInterfaceOrientationLandscapeLeft || orientation == UIInterfaceOrientationLandscapeRight )
        {
            [UIView animateWithDuration:duration
                             animations:^
                             {
                                 //Fade the landscape view over the top of the 
                                 //portrait view as during rotation 
                                 landscapeView.alpha = 1.0f;
                             }
                             completion:^(BOOL finished)
                             {
                                 //Hide the portrait view when landscape is fully
                                 //visible
                                 portraitView.alpha = 0.0f
                             }];
        }
        else
        {
            //Show the portrait view (underneath the landscape view)
            portraitView.alpha = 1.0f;
    
            [UIView animateWithDuration:duration
                             animations:^
                             {
                                 //Fade out the landscape view to reveal the portrait view
                                 landscapeView.alpha = 0.0f;
                             }];
        }
    }
    

    Your controls and subviews will fade and deactivate along with the appropriate views, allowing you to have completely different content. I used this recently to fade between two different background images when changing orientation. The effect is very smooth.

    You can now create your two view controllers, A and B which each manage two views as described above. You can then simply push the view controllers as normal and not have to worry about managing the UINavigationController’s view controller stack during rotation.

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

Sidebar

Related Questions

Somebody said that when your PHP code and application use global variables then it
What is an alternate entry point in a BlackBerry application? When should we use
Can the application use set same char in the XON and XOFF? If yes,
I am wanting to expose some data service endpoints for internal application use and
I'm using Visual Studio to create my installation package. My application use some bitmap
My application makes use of a SQLite database to store the user's inputs. The
An application I use, Mozy Backup , adds its own drive to Windows Explorer
We have an application for use in medical offices, and with CCHIT certification becoming
In my application I use a UIAlertView to display to the user a message
In our Spring application we use clustered Hibernate Search with ActiveMQ which sets up

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.