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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:49:45+00:00 2026-05-29T09:49:45+00:00

I have an app which has a UITabBarController, and when different tabs are pressed,

  • 0

I have an app which has a UITabBarController, and when different tabs are pressed, I override viewWillAppear, get a reference to the tabBarController and then resize its frame. The reason for doing so is that some tabs require the full height of the screen, whilst other tabs have a background in the top 120pixels.

The way I am referencing the tabBarcontroller is by getting the application delegate and using its reference to the tabBarController to move its position:

MyAppDelegate *del= [UIApplication sharedApplication].delegate;
del.tabBarController.view.frame = CGRectMake(0,120,320,360);

This method works fine when switching between tabs, but the first time the application loads up it does things a bit weirdly, and I cant understand why. My first tab actually has a NavigationBar, and then contains a view which has a pickerView. The first time my application loads, the NavigationBar appears about 10px too low, however the pickerView still appears in the right position. I was hoping I could get around this by treating things differently the first time viewWillAppear is called, however if I decrease the y position to compensate for the navigation bar, it shifts everything together including the datepicker within the view.

I would like to understand why the application behaves differently when first loaded and was hoping someone could either explain this to me and with any ideas on how to solve the issue or please point me in the right direction. I suspect this has something to do with the status bar on top since that is about the same size as the offset I am seeing..

Any help would be appreciated!
thanks

  • 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-29T09:49:46+00:00Added an answer on May 29, 2026 at 9:49 am

    OK I’ve figured it out. If anyone is interested, it appears that on application startup, the UINavigationBar‘s frame has a y position of 10 pixels. All I had to do was set the UINavigationBar‘s frame vertical position back to 0 pixels and all works! Anyone needing to do this, here’s the code:

    self.navigationController.navigationBar.frame = CGRectMake(0,0,320,45)
    

    I call the above line in the viewWillAppear method and all works as expected.

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

Sidebar

Related Questions

I have rails app which has a list of users. I have different relations
I have an iPhone app which has a tabBarController as the root view controller
sorry for the newbie question: I have an app which has projects with different
I have an app which has different app identifier for iphone and ipad and
I have a .net winforms app which has a few animation effects, fade ins
I have an view in my App which has a number of buttons based
I have a user profile page on my web app which has contact information.
I have an app, which has a top navigation bar and a bottom tab
I have an app which is quite huge. It has tons of images and
I have a GUI app written in C++/CLI which has a load of configurable

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.