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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:35:24+00:00 2026-06-07T07:35:24+00:00

I´m programming an app on iOS5 ipad. when a custom view finish load, on

  • 0

I´m programming an app on iOS5 ipad.

when a custom view finish load, on viewDidLoad, i call a function that set an aspect to some programically views like:


switch (interfaceOrientation) 
            {
                case UIDeviceOrientationPortrait:
                {
                    // Size 3 views using self.view.bounds.size.height
                    // and self.view.bounds.size.width
                    break;
                }
                case UIDeviceOrientationPortraitUpsideDown:
                {
                    // Size 3 views using self.view.bounds.size.height
                    // and self.view.bounds.size.width
                    break;
                }
                case UIDeviceOrientationLandscapeLeft:
                {
                    // Size 3 views using self.view.bounds.size.height
                    // and self.view.bounds.size.width
                    break;
                }
                case UIDeviceOrientationLandscapeRight:
                {
                    // Size 3 views using self.view.bounds.size.height
                    // and self.view.bounds.size.width
                    break;
                }

                default:
                    break;
            }

And i call that function on shouldAutorotateToInterfaceOrientation:


- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    [self setAspect:aspect];
    return YES;
}

When i rotate the app, put the views on the correct position, but, when is launched the app, if i have the ipad on Landscape, it don´t work correctly. It take the sizes of portrait. If i rotate the device, the problem is fixed, but i don´t like that problem in my app.

I don´t know why could be happening this, i have readed that call aspect on viewdidload is too early. Where must I call it the setAspect function?

  • 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-07T07:35:26+00:00Added an answer on June 7, 2026 at 7:35 am

    I had this same issue today.

    I ended up having to add: self.view.autoresizesSubviews = YES; to my viewDidLoad method, even though I had autoresize checked in Interface Builder.

    -(void)viewDidLoad
    {
        [super viewDidLoad];
    
        self.view.autoresizesSubviews = YES;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm programming an IOS App for iPad in IOS5 and I want that when
I am programming an app, that automatically answers a call. The problem is, that
I am programming a Java app in which i need to constantly check that
I'm programming an Android app, where I have to store pictures to some online
I am programming an app that shows a lot of verses/poems so text wrapping
I'm currently programming a Java App where I want to only allow some window
I am programming an app that will store a database locally and would like
I'm programming app that need to make a check on a contact, when user
I am programming a app that has to do a operation with high cpu
In the meantime of programming my app, it occurred, that even if i push

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.