How to show status bar initially hidden from plist

2019-04-27 12:41发布

问题:

i want to hide the status bar when i launch my app to view launch image that was covered by status bar. so in plist i added

Status bar is initially hidden YES

and status bar is covered. My problem is that status bar is covered always in my app, i want to hide status bar only for launch image, what can i do?

回答1:

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


回答2:

SOLVED

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

using this at launch of app :)



回答3:

you can do this by adding property, "Status bar Initially Hidden" to plist as shown below : -



回答4:

OR

you can also set the (Status bar Initially Hidden)Property to "NO" in Info.plist file in your Application.

Just uncheck this property.



回答5:

Neither Niko's nor JackTurky's solutions are correct. Niko's:

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

...works but is deprecated. Correct in iOS 3.2 and later is:

[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];