To completely hide it on the home screen, open up an app, such as Settings, and wait about three to four seconds. Press the home button again, and the status bar will be completely gone.
You need to add this code in your AppDelegate file, not in your Root View Controller
Or add the property Status bar is initially hidden in your plist file
Folks, in iOS 7+
please add this to your info.plist file, It will make the difference :)
UIStatusBarHidden UIViewControllerBasedStatusBarAppearance
For iOS 11.4+ and Xcode 9.4 +
Use this code either in one or all your view controllers
override var prefersStatusBarHidden: Bool { return true }
Add the following code to your view controller:
if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) {
// iOS 7
[self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)];
} else {
// iOS 6
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];
}
- (BOOL)prefersStatusBarHidden {
return YES;
}
What helped me is this (changing plist file):
Put this code to your view controller in which you hide status bar:
- (BOOL)prefersStatusBarHidden {return 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