I can get the status bar to hide, but the application still respects the height of the bar (see image below). I also need to make sure there's not a 'flicker' of the status bar hiding on initial load since it pushes the nav menu button down and it jumps back up on hide.
Methods I've tried:
Added the following in my main controller. This one flickrs the layout on initial load.
// hide the status bar
ionic.Platform.fullScreen();
Set Key, Value pairs in info.plist
<key>UIStatusBarHidden</key>
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
which equates to:
Status bar is initially hidden = YES
View controller-based status bar appearance = NO
Tried using the the StatusBar plugin on load:
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
// Hide the status bar
if(window.StatusBar) {
StatusBar.hide();
}
});
})
Tried setting the following in my MainViewController.m
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade];
and add new method
- (BOOL)prefersStatusBarHidden {
return YES;
}
I've tried about 3 different cordova plugins off of github.
I'm also a web developer, so when providing answers that involve changing obj-c, please explain like I'm 5 :}
http://forum.ionicframework.com/t/how-to-hide-uistatusbar/4025
Thanks!
I left a comment for you on your post but here's the solution I came up with.
What you can do is install the splash screen pluign
$ cordova plugin add org.apache.cordova.splashscreen
Then do this in your .run function
.run(function ($ionicPlatform, $timeout) {
$ionicPlatform.ready(function () {
// Hide the status bar
if (window.StatusBar) {
StatusBar.hide();
$timeout(function () {
window.navigator.splashscreen.hide();
}, 2500);
}
});
})
Try implementing prefersStatusBarHidden in your view controller. e.g.
- (BOOL)prefersStatusBarHidden
{
return YES;
}
For ios 7 in each view write method :
- (BOOL)prefersStatusBarHidden
{
return YES;
}
And for ios 6 write follwing once in homeview or appdelegate
[UIApplication sharedApplication].statusBarHidden = YES;
In 'CDVViewController.m'
, go to
- (void)viewDidLoad
and insert the below
[[UIApplication sharedApplication] setStatusBarHidden:YES];
My CDVViewController.m looks like this,
- (void)viewDidLoad
{
[super viewDidLoad];
NSURL* appURL = nil;
NSString* loadErr = nil;
[[UIApplication sharedApplication] setStatusBarHidden:YES];
.....