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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:52:40+00:00 2026-06-09T23:52:40+00:00

I am hiding the status bar and navigation bar in viewDidLoad – (void)viewDidLoad {

  • 0

I am hiding the status bar and navigation bar in viewDidLoad

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self.navigationController setNavigationBarHidden:YES animated:YES];
    [[UIApplication sharedApplication] setStatusBarHidden:YES];
}

Everything works fine. But then, when I dismiss the view controller, in viewWillDisappear: I do:

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

This causes my all the views to be badly positioned:
enter image description here

What am I doing wrong?
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-06-09T23:52:42+00:00Added an answer on June 9, 2026 at 11:52 pm

    I haven’t tried it so I’m just speculating.
    Your navigation bar has a frame set as if there is no Status bar. Something is done in the wrong order.
    So in your code I see that when the navigation bar is asked to be made visible when there is no status bar present.

    [self.navigationController setNavigationBarHidden:NO animated:YES];    
    [[UIApplication sharedApplication] setStatusBarHidden:NO];
    

    Have you tried inverting those 2 lines? ( I’m only guessing )

    My other test would be to set the navigation bar visible in the viewDidAppear.
    At that time the applicationFrame should have updated to the fact that the status bar is visible again.


    I’ve tested it, and inverting the call make it work. But you won’t get animation for the navigation bar and status bar. If you want them I suggest placing your those call in viewWillAppear or in viewDidAppear

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

Sidebar

Related Questions

I found that after setting the [[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO] at viewDidLoad , then
I'm using NSMediaPlayer to play my video. I'm hiding the status bar on the
I am hiding status bar and title bar throught out my app by adding
I'm having an issue removing/hiding the status bar. I have looked at other posts
When doing an asynchronous HTTP request, I hide the iPhone status bar and animate
When hiding the Task Bar on Vista and Windows 7 the Start Button (also
I have implemented master pages using this example How to implement a status bar
I'm pretty sure that I've taken all steps to correctly set my status bar
I have a UINavigationController with a visible Navigation Bar. I have one particular UIViewController
my iPhone app uses OpenGL ES in full screen mode (the status bar is

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.