IOS development-hide the status bar (battery bar)
There are two scenarios:
1. To hide the status bar of A view, for example, when interface A is pushed to interface B, interface A originally displays the status bar. However, interface B does not display the status bar.
At this time, you can do this:
Implement in B:
-(Void) viewDidLoad {[super viewDidLoad]; if ([self respondsToSelector: @ selector (listener)]) {// iOS 7 [self prefersStatusBarHidden]; [self callback mselector: @ selector (setNeedsStatusBarAppearanceUpdate)] ;}}-(BOOL) prefersStatusBarHidden {return YES; // hide as YES and display as NO}
In addition, add the following in the plist file:
Set key: View controller-based status bar appearance to YES
2. This is relatively simple. All views directly hide the status bar. It is also relatively simple.
(Set in plist ):
First, set key: Status bar is initially hidden to YES.
Then set key: View controller-based status bar appearance to NO
You can hide the status bar globally.