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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:01:51+00:00 2026-06-13T19:01:51+00:00

After upgrading my project to iOS 6, I realized that auto layout is only

  • 0

After upgrading my project to iOS 6, I realized that auto layout is only effective in viewDidAppear and most of my code expects the view’s frame to be available in viewDidLoad. This limitation renders the really nice auto layout feature almost useless for me. Is there any suggestions to help me use auto layout?

For example, sometimes the developer needs to adjust information about a subview based on where auto layout chooses to place that particular subview. The subview’s final location cannot be ascertained by the developer until AFTER the user has already seen it. The user should not see these information adjustments but be presented the final results all at once.

More specifically: What if I want to change an image in a view based on where auto-layout places that view? I cannot query that location and then change the image without the user seeing that happen.

  • 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-13T19:01:52+00:00Added an answer on June 13, 2026 at 7:01 pm

    As a general rule, the views frame/bounds should never be relied on in viewDidLoad.

    The viewDidLoad method only gets called once the view has been created either programmatically or via a .nib/.xib file. At this point, the view has not been setup, only loaded into memory.

    You should always do your view layout in either viewWillAppear or viewDidAppear as these methods are called once the view has been prepared for presentation.

    As a test, if you simply NSLog(@"frame: %@", NSStringFromCGRect(self.view.frame)); in both your viewDidLoad and viewWillAppear methods, you will see that only the latter method returns the actual view size in relation to any other elements wrapped around your view (such as UINavigationBar and UITabBar).

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

Sidebar

Related Questions

My project no longer compiles for the iOS 5.0 Simulator after upgrading to automatic
After upgrading a project from Flex4 Beta1 to Beta2, I've found that the background-image
I have an NServicebus project that I cannot start after upgrading from 2.6 to
After upgrading our VS2008 Project to VS2010 we found that VS would take 60
After upgrading to Lion and re-building the project I noticed that Apple's texturetool started
After upgrading to 12.04, my Eclipse that I had since 11.10 has been full
After upgrading to ReSharper5 it gives me even more useful tips on code improvements.
After upgrading to latest Eclipse ADT 17 , whenever I start editing layout in
I noticed after upgrading from 4.2 to 4.3.1 that there is no longer a
I have just discovered that after upgrading to the latest Xcode 3.2.2, I am

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.