I tried to hide status bar in iOS7 by putting this:
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade];
in delegate or in mainview
But it's not working!
It was working in iOS6
I tried to hide status bar in iOS7 by putting this:
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade];
in delegate or in mainview
But it's not working!
It was working in iOS6
Either set "View controller-based status bar appearance" to NO in your info plist or add this code in your view controllers:
-(BOOL)prefersStatusBarHidden
{
return YES;
}
Add the following to your Info.plist:
UIStatusBarHidden UIViewControllerBasedStatusBarAppearance
or follow this link http://www.openfl.org/developer/forums/general-discussion/iphone-5ios-7-cant-hide-status-bar/
In a viewController where you want to hide status bar add:
- (BOOL)prefersStatusBarHidden
{
return YES;
}
In viewDidLoad
[self prefersStatusBarHidden];
[self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)];
In app *-info.plist
View controller-based status bar appearance set to YES
Try this.
In your iOS target -> Info, add View controller-based status bar appearance and set the value as NO.
It worked for me in iOS7. I have also set "status bar initially hidden" property to YES
//viewDidload
if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) {
// iOS 7
[self prefersStatusBarHidden];
[self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)];
} else {
// iOS 6
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade];
}
// Add this Method
- (BOOL)prefersStatusBarHidden
{
return YES;
}
this wil work ..hope it helps
In your apps plist file add a row call it " UIViewControllerBasedStatusBarAppearance" and set it to NO
from http://www.openfl.org/developer/forums/general-discussion/iphone-5ios-7-cant-hide-status-bar/, mgiroux's solution
In the Plist add the following properties.
Status bar is initially hidden = YES
View controller-based status bar appearance = NO
now the status bar will hidden.