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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:47:30+00:00 2026-05-14T15:47:30+00:00

Hey all. I have a fairly simple question. I am developing a rich iPad

  • 0

Hey all. I have a fairly simple question. I am developing a “rich” iPad app, and I have two background images specifically designed for landscape and portrait. I’d like this ImageView to automatically change depending on the devices orientation. (like pretty much all of Apples iPad apps).

Can anyone point me in the right direction? I’m assuming it would be something I do on viewDidLoad..

  • 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-14T15:47:31+00:00Added an answer on May 14, 2026 at 3:47 pm

    The best thing you can do is to change the frames of your subview frames according to your interface orientations. You can do it like:

     #pragma mark -
     #pragma mark InterfaceOrientationMethods
    
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
        return (UIInterfaceOrientationIsPortrait(interfaceOrientation) || UIInterfaceOrientationIsLandscape(interfaceOrientation));
    }
    
    //--------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{
        [super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
        if(UIInterfaceOrientationIsPortrait(toInterfaceOrientation)){
            //self.view = portraitView;
            [self changeTheViewToPortrait:YES andDuration:duration];
    
        }
        else if(UIInterfaceOrientationIsLandscape(toInterfaceOrientation)){
            //self.view = landscapeView;
            [self changeTheViewToPortrait:NO andDuration:duration];
        }
    }
    
    //--------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    - (void) changeTheViewToPortrait:(BOOL)portrait andDuration:(NSTimeInterval)duration{
    
        [UIView beginAnimations:nil context:NULL];
        [UIView setAnimationDuration:duration];
    
        if(portrait){
            //change the view and subview frames for the portrait view
        }
        else{   
            //change the view and subview  frames for the landscape view
        }
    
        [UIView commitAnimations];
    }
    

    Hope this helps.

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

Sidebar

Related Questions

Argh. Hey all, i have a muy simple django question: And argh, i'm sorry,
Hey all. I have a question on how to implement the following with Django.
Hey all, i have made a simple form that mimiks the jQuery GROWL effect
Hey all, I have a list of 4 thumbnail images. When one of these
Hey all i have two JFrames one is my main login frame, user enters
Hey all, I have a linq app using C# express2008 and sqlserver express 2005
Hey I have a fairly basic question about regular expressions. I want to just
Hey all. I'll try to make this brief and simple. :) I have 40
Hey all! I'm fairly new to objective-c so I have never had to tackle
Hey all - I have an app where I'm authenticating the user. They pass

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.