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

  • Home
  • SEARCH
  • 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 3611896
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:55:55+00:00 2026-05-18T21:55:55+00:00

I am currently working on a project and I need to support both portrait

  • 0

I am currently working on a project and I need to support both portrait and landscape orientation. I have read several books, and all of them tell me to do different things. The view I want to support landscape orientation is simple. It is a UINavigationBar and a UIWebview which is attached to the viewcontrollers view. I have made the view programatically.

Is it correct that I use this method:
– (void)willAnimateRotationToInterfaceOrientation: (UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration;

I have seen that prior to iOS 3 there was two other methods that were invoked. However I do not target my app below iOS 3.

This code is working but my question is if it is the correct way of doing it programmatically because I don’t want to use the InterfaceBuilder on this view.

Codesnippet (working)

- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)x duration:(NSTimeInterval)duration {
   if (UIInterfaceOrientationIsLandscape(x)) {
      topbar.frame = CGRectMake(0.0f, 0.0f, 480.0f, 44.0f);
   }
}

And is it correct that I don’t need to apply any animation, iOS will handle this right?

  • 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-18T21:55:56+00:00Added an answer on May 18, 2026 at 9:55 pm

    You can use the below two methods to support interface orientations

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{
    
     //Set the boolean variable for interface orientation condition. 
    
    }
    
    
    - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation duration:(NSTimeInterval)duration {
    //Set the coordinates of the Views you are using.
    
    }
    

    Yes you do not have to worry about the animation part,the OS will take care of it.

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

Sidebar

Related Questions

In the project I am currently working on, we have the need to develop
I am currently working on a project where users need to be able to
I'm currently working on a pet project and need to do C++ development on
I'm currently working on project with Haskell, and have found myself some trouble. I'm
We are currently working on a project with both actionscript and Java. Up to
I am currently working on a large project and will relatively soon need a
I am currently working in a .Net project but from university I have also
For a current project I am working I need to return an aggregate report
I am currently working on a project and my goal is to locate text
I am currently working on a project with specific requirements. A brief overview of

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.