Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check whether status bar is hidden or visible

I want to check condition for statusbar. How can i check condition if status bar is visible or not .

please anyone guide me to do this..

Thank you all

like image 219
Prajan Avatar asked Aug 16 '11 12:08

Prajan


People also ask

How to hide status bar in Android activity?

Hide the Status Bar on Android 4. View decorView = getWindow(). getDecorView(); // Hide the status bar. // status bar is hidden, so hide that too if necessary.

How to remove status bar in Android programmatically?

If you are going to hide status bar at runtime you can add getWindow(). addFlags(WindowManager. LayoutParams. FLAG_FULLSCREEN); before setContentView of onCreate method.


1 Answers

Check if status bar is hidden:

Objective C:

if ([UIApplication sharedApplication].isStatusBarHidden) {     // do stuff here... } 

Swift:

if UIApplication.shared.isStatusBarHidden {     // do stuff here... } 

Hide status bar:

override var prefersStatusBarHidden: Bool {     return true } 
like image 75
Mobile Developer Avatar answered Sep 20 '22 05:09

Mobile Developer