In ios7, how can I hide the statusbar programmatically? I am using XCode 4.6.1
(ios6.1) and I want to implement this in XCode itself.
Go to Your info. plist file. Add a key called “View controller-based status bar appearance” and set its value to NO.
A status bar appears along the upper edge of the screen and displays information about the device's current state, like the time, cellular carrier, and battery level.
in iOS7 you should implement in your viewController
- (BOOL)prefersStatusBarHidden { return YES; }
you can hide status bar to set the key value "View controller-based status bar appearance" NO in plist. This is easiest way.
or You can hide in code by using property statusBarHidden of UIApplication class.
[[UIApplication sharedApplication] setStatusBarHidden:YES];
Swift 3.0
Hide status bar for any particular view controller
override var prefersStatusBarHidden: Bool { get { return true } }
Hide Status bas across the application
UIApplication.shared.isStatusBarHidden = true
and set the key value "View controller-based status bar appearance" NO in info plist of project.
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