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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:27:03+00:00 2026-05-23T23:27:03+00:00

When setStatusBarHidden:NO is set before the view loads, the UINavigationBar and other elements appear

  • 0

When setStatusBarHidden:NO is set before the view loads, the UINavigationBar and other elements appear aligned immediately below the StatusBar as they should. However, when setStatusBarHidden:NO is set after the view loads, the UINavigationBar is partially covered.

The StatusBar must be revealed after loading the said view, but how can this be done without encountering the aforementioned problem?

  • 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-23T23:27:05+00:00Added an answer on May 23, 2026 at 11:27 pm

    I found a hack in a code of mine, though can’t remember or find where it came from. The trick is to refresh the navigation bar by hiding and reshowing it:

    [self.navigationController setNavigationBarHidden:YES animated:NO];
    [self.navigationController setNavigationBarHidden:NO animated:NO];
    

    In my code the function looks like this:

    - (void)viewWillAppear:(BOOL)animated {
        [super viewWillAppear:animated];
    
        [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
    
        [self.navigationController setNavigationBarHidden:YES animated:NO];
        [self.navigationController setNavigationBarHidden:NO animated:NO];
    }
    

    However, BE WARNED, this is a hack, and currently I’m struggling with some bugs that appear to originate from this code (navigation item doesn’t match navigation content). But since it did work for me in some places, I’d thought I’d mention it.

    Edit:
    I think I found the initial post here:
    How do I get the navigation bar in a UINavigationController to update its position when the status bar is hidden?

    GL,
    Oded

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

Sidebar

Related Questions

I have set my status bar hidden in my Application. [application setStatusBarHidden:YES]; I have
I am having a strange problem: In -(void)viewWillAppear:(BOOL)animated method I use: [[UIApplication sharedApplication] setStatusBarHidden:YES
I've used this code to hide the status bar [application setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone]; On the
I create views programmatically. To hide status bar in view I use [UIApplication sharedApplication]
I'm developing an iPhone app that switches from a table view to a landscape
As soon as I add a UIImagePickerController sub view to my view the status
I have view which contains a scrollView. When the view shows up the image
I have an app where my main view accepts both touchesBegan and touchesMoved ,
I found that after setting the [[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO] at viewDidLoad , then
I'd like to show and hide the statusBar and the navigationBar simultaneously using a

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.