Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone:Problem with hiding/showing status bar in multiple view controller

Tags:

I have some issues with Status Bar Hidden logic.

I am having a flash screen before starting my game. In the flash screen controller, i use "[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO];" under 'viewDidLoad' to hide the status bar and show the flash screen to occupy the entire iPhone screen.

Issue 1: It shows status bar for some fraction of seconds during my flash screen launch and then hides it. I don't want to get status bar even in the fraction of seconds also, it should just hide it once flash screen started. How to achieve it?

Issue 2: After the flash screen controller view, my game application home screen will be launched. If i use "[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO];" under 'viewDidLoad' in Flash screen controller, it affects in my Game home screen view controller also. My game home screen controller also hides Status Bar. I don't want that. I want to hide the status bar only on flash screen, other views of my application should show status bar always. How to correct this?

Your suggestions are well appreciated.

like image 474
Getsy Avatar asked Nov 25 '09 06:11

Getsy


People also ask

How do I hide my status bar on storyboard?

step 1 : in your frameWork-Info. plst' file, add the key 'View controller-based status bar appearance' and set it to 'NO'.

Where is the status bar on iPhone?

The icons in the status bar at the top of the screen provide information about iPhone. On an iPhone with Face ID, there are additional status icons at the top of Control Center. Note: If you turn on a Focus, its icon appears in the status bar.


1 Answers

to make the status bar hidden during while your app launches, add the "status bar is initially hidden" key to your apps info plist.

then, in your first non-splash view, use

[[UIApplication sharedApplication] setStatusBarHidden:NO animated:NO];

in your viewDidLoad or viewDidAppear.

like image 191
David Maymudes Avatar answered Oct 11 '22 16:10

David Maymudes