Reputation: 19214
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
Upvotes: 1
Views: 436
Reputation: 2127
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.
Upvotes: 0
Reputation: 772
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/
Upvotes: 2
Reputation: 2002
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
Upvotes: 0
Reputation: 8800
//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
Upvotes: 0
Reputation: 35394
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;
}
Upvotes: 4
Reputation: 5508
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
Upvotes: 0
Reputation: 4817
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
Upvotes: 0