In my iOS video app status bar is hidden in some view controllers. I have done this using following code.
[[UIApplication sharedApplication] setStatusBarHidden:YES];
It works for iOS 5 and iOS 6 , but not in iOS 7.
I tried with this in particular view controller,
Eg:
-(BOOL)prefersStatusBarHidden { return YES; }
It works well, but I cant show status bar again in the parent view controller.
iOS 9 onwards :
As
statusBarHidden
method was Deprecated from iOS9 you need to add two values in plist as below :or by User Interface Please refre below image :
As
statusBarHidden
is Deprecated from iOS9 :Add following line in viewdidload
and add new method
also change info.plist file View controller-based status bar appearance" = NO
its works for me
Add the following to your Info.plist:
I did the following and it seems to work (even in iOS 8):
Try that;
To answer the Susitha's question: use setNeedsStatusBarAppearanceUpdate. This will make a call to prefersStatusBarHidden to refresh with your desired status bar state. Try this:
If you want to see the status bar again, set your property hideStatusBar (or whatever you call it) to NO. Call preferStatusBarHidden indirectly by making another call to