Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide UINavigationBar but still show Status Bar

How can I hide the navigation bar by not hiding the status bar in my app? When I try [self.navigationController.navigationBar setHidden:YES]; it also hides the status bar. I need to show the status bar like this:

enter image description here

I need to first hide a visible navigation bar, make the status bar still visible and I also have a view that I need to move below the status bar, but the view is being positioned like the navigation bar is still there when I set the frame's position to 0,0.

I setup my statusbar as:

[[UIApplication sharedApplication] setStatusBarHidden:NO];
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
like image 657
SleepNot Avatar asked Mar 18 '14 07:03

SleepNot


People also ask

How to hide the action bar without the status bar?

Note that the action bar is hidden too. You should never show the action bar without the status bar. Figure 2. Hidden status bar. You can hide the status bar on Android 4.0 (API level 14) and lower by setting WindowManager flags. You can do this programmatically or by setting an activity theme in your app's manifest file.

How to show or hide status bar in File Explorer?

To Show or Hide Status Bar in File Explorer using Folder Options 1 Open Folder Options . 2 Click/tap on the View tab, check (default) or uncheck Show status bar in "Advanced settings" for what you want, and click/tap on OK .

How do I use flag_layout_in_screen with the status bar?

You can use FLAG_LAYOUT_IN_SCREEN to set your activity layout to use the same screen area that's available when you've enabled FLAG_FULLSCREEN. This prevents your content from resizing when the status bar hides and shows.

How to display status bar in Microsoft Excel?

Step 1: Hold down the Alt + F11 keys in Excel, and it opens the Microsoft Visual Basic for Applications window. Step 2: Click Insert > Module, and paste the following macro in the Module Window. VBA for displaying status bar in Microsoft Excel. Sub Show_Status_Bar()


1 Answers

Add this to your code where you want to hide the navigation bar

[self.navigationController.navigationBar setHidden:YES];

like image 161
Rose Avatar answered Sep 19 '22 08:09

Rose