At the start of my app, the status bar is hidden, due to the Info.plist setting called Status bar is initially hidden
. Later on, I want to show the status bar using:
[[UIApplication sharedApplication] setStatusBarHidden:NO animated:YES];
but I get a warning saying that the function is deprecated. Does anybody know what the new function is?
setStatusBarHidden:withAnimation:
is the new method, which takes a UIStatusBarAnimation
instead of a BOOL
, so you can choose what animation is used to hide the status bar.
It is:
- (void)setStatusBarHidden:(BOOL)hidden withAnimation:(UIStatusBarAnimation)animation
See the UIApplication class reference for more info.
If you are trying to write code for both iOS 3.x and iOS 4.x, you are going to run into a further issue that the new method is not available in the old iOS. See this question for further info.
Add this to your AppDelegate.m
[UIApplication sharedApplication].statusBarHidden = YES;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With