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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:10:20+00:00 2026-06-17T13:10:20+00:00

I am migrating my apps over and on one I use a UIPickerView .

  • 0

I am migrating my apps over and on one I use a UIPickerView. In the viewDidLoad method I create the picker and set it’s y origin to be self.view.frame.size.height so that it is off screen. Then I just move it up when needed.

On the iPhone 5 self.view.frame.size.height is still returning 480 yet the UIView fills the screen correctly.

I’ve even tried using CGRectGetHeight(self.view.bounds) thinking that it may return something different…no dice. Any ideas as to why this maybe occurring.

  • 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-17T13:10:21+00:00Added an answer on June 17, 2026 at 1:10 pm

    That is because the size you selected in the view’s nib will be used until viewWillAppear: (BOOL) animated method. Then it will take the correct size.

    However you can use the following code to have the correct size since viewDidLoad is called:

    CGSize viewSize = [[UIScreen mainScreen] bounds].size;
    viewSize = CGSizeMake(viewSize.width, viewSize.height - STATUS_BAR_HEIGHT);
    

    STATUS_BAR_HEIGHT is 20 but it depends on your app. You may or may not need to add that line.

    EDIT

    The problem with using mainScreen bounds is that the frame doesn’t change on orientation change. That is the way it is designed. You can work it out with the following:

        CGSize viewSize = [[UIScreen mainScreen] bounds].size;
    
        if(UIInterfaceOrientationIsLandscape(CURRENT_ORIENTATION)){
            viewSize = CGSizeMake(viewSize.height, viewSize.width - STATUS_BAR_HEIGHT);
    
        } else {
            viewSize = CGSizeMake(viewSize.width, viewSize.height - STATUS_BAR_HEIGHT);
        }
    

    CURRENT_ORIENTATION is [[UIApplication sharedApplication] statusBarOrientation];

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

Sidebar

Related Questions

I'm migrating my application from Rails 3.0.12 to 3.2. I use the active_record_store to
I'm migrating an old Sybase database to MySQL and I have to create foreign
I'm migrating my apps from WebSphere to JBoss. I would like to know if
I am in the process of migrating some GAE apps from Python 2.5 to
I just deployed one of my apps to heroku. This app uses : A
I'm slowly moving my rails website from a traditional rails round-trip-for-each-view application to one
One of my apps has an initial_data.json file in /fixtures, which works great when
This is the best tutorial I found so far on migrating data across apps:
I'm currently migrating old web apps from JBoss As 4.2.2 to 6.0.0 (AS6) .
I am converting an existing codebase (with several apps) to use South. My codebase

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.