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

  • Home
  • SEARCH
  • 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 9265915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:11:42+00:00 2026-06-18T14:11:42+00:00

I have a navigationbar-positioning problem that seems to have appeared with iOS6. It acts

  • 0

I have a navigationbar-positioning problem that seems to have appeared with iOS6.
It acts in many ways similar to the proplem some users are experiencing when rotating some views

The app has a splash screen, displayed full screen (achieved by setting Hide statusbar during application launch to True)

Then in viewDidLoad in my Master View Controller the following line adds the statusbar back to the app:

[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];

This adds the StatusBar to the app, and shifts the view downwards 20pt as expected.
However, the NavigationBar stays put, underneath the StatusBar with a 20pt glitch underneath.

The glitch created by adding statusBar

Before iOS6 I used to fix this by adding the following line of code:

[UIApplication sharedApplication].keyWindow.frame=CGRectMake(0, 20, 320, [[UIScreen mainScreen] bounds].size.height-20);

Now, however, this do not work.

Some research shows that at the time of calling viewDidLoad, keyWindow.frame has a size and origin both of {0,0}, and altering it has no effect.

When inserting the two lines mentioned above to viewDidAppear I get the same behaviour when the app launches. When I dhen move to another view and back to the first view however, the alteration of keyWindow.frame has the desired effect and the NavigationBar ends up positioned where it should be.

My question then: How to make the NavigationBar gets it’s right position after adding the StatusBar to an iOS-app when the StatusBar is initially hidden?

  • 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-18T14:11:43+00:00Added an answer on June 18, 2026 at 2:11 pm

    Seems like I’m asleap at work again:

    The effect of doing things in the other methods (view[Will|Did]Appear) do not apply since the statusbar are already displayed by the calling from viewDidLoad. I did remove the code from there and then got the desired effect from viewDidAppear. Any of the methods called earlier do not alter the child frame. (Neither viewDidLoad or viewWillAppear alters the frame of [UIApplication sharedApplication].keyWindow.frame)

    So this has to be done in viewDidAppear. Just make sure the statusbar has not aleready been displayed in some of the methods called before…

    -(void)viewDidAppear:(BOOL)animated {
        [super viewDidAppear:animated];
        [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:NO];
        [UIApplication sharedApplication].keyWindow.frame=CGRectMake(0, 20, 320, [[UIScreen mainScreen] bounds].size.height-20);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this UIPopOverScreen that shows when I press a NavigationBar Button. The problem
I have UINavigationController in my application, at some point I hide NavigationBar using following
what do I have to do, to show a navigationbar in a view, that
I have a NavigationController based iPhone app that has a navigationBar and a toolbar.
I have a page, with a navigationbar that loads content, from another page, into
I have a navigationController w/navigationBar and that is always displayed at the top of
I have a usual editButtonItem in my navigationBar (created by the system), and I'd
I have a navigation bar that tells the user which page is selected by
I have a navigation bar that has two dropdowns (as nested ul's). I'm trying
I want to have a navigation bar with a settings button on it that

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.