I want to hide status bar in my entire app.
Also I know it too, that we can do it by this way :
set the key value "View controller-based status bar appearance" NO in plist.
But I need to do the same only for iOS 7, so of course there need some condition for OS version and as of my knowledge we can not apply any condition in .plist file.
So anyone please suggest some line of code which only hide status bar for iOS 7.
Appreciate on your response.
add the following code to your view controllers:
- (BOOL)prefersStatusBarHidden {
return YES;
}
this will not disturb any ios below 7 because it is only called in ios7.
//Checking iOS version
float versionOS;
versionOS=[[[UIDevice currentDevice] systemVersion] floatValue];
if(versionOS>=7.0)
{
[UIApplication sharedApplication].statusBarHidden = YES
}
Add this code into application didFinishLaunchingWithOptions
method.
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