# iOs header size is too large

**URL:** <https://forum.ionicframework.com/t/ios-header-size-is-too-large/16127>\
**Category:** ionic-v1\
**Created:** [January 21, 2015, 3:45pm UTC](https://forum.ionicframework.com/t/ios-header-size-is-too-large/16127 "2015-01-21T15:45:31Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Apavillet](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@Apavillet](https://forum.ionicframework.com/u/Apavillet)\
**Post date:** [January 21, 2015, 3:45pm UTC](https://forum.ionicframework.com/t/ios-header-size-is-too-large/16127/1 "2015-01-21T15:45:31Z")

</div>

On iOs ( 8 but also 7 ) the header height is too big.

While tracking this I found that the scss says that :not(.fullscreen) should be 64px and adding fullscreen class to the body does make the trick.

Maybe i’m not getting it right but if fullscreen means no status bar that’s not what I want and if not should I and how can I add the fullscreen class the body?

EDIT : adding `ionic.Platform.fullscreen();` the app is fullscreen and the header height is ok but no status bar. Which is the intented way I think but why then removing fullscreen makes the header that tall?

Many Thanks

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [January 21, 2015, 4:51pm UTC](https://forum.ionicframework.com/t/ios-header-size-is-too-large/16127/2 "2015-01-21T16:51:03Z")

</div>

So a little loss in what you are asking here.

`ionic.Platform.fullscreen();` will hide the status bar and make the header bar only 44px tall.

If the app is not fullscreen, the header will get an extra 20px to accommodate iOS’s status bar.

What seems to be the issue?

---

<div class="post-metadata">

**Author:** ![Apavillet](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@Apavillet](https://forum.ionicframework.com/u/Apavillet)\
**Post date:** [January 21, 2015, 5:01pm UTC](https://forum.ionicframework.com/t/ios-header-size-is-too-large/16127/3 "2015-01-21T17:01:13Z")

</div>

Thanks @mhartington the issue is that if not fullscreen, the header is 64px tall ( the +20 you’re talking about I think ) but i’m not sure you need to compensate the status bar. See the attached screenshot :

 ![image](https://global.discourse-cdn.com/ionicframework/original/2X/6/69f4939ba18d46b681677225ada23b48c173f41b.png)

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [January 21, 2015, 5:52pm UTC](https://forum.ionicframework.com/t/ios-header-size-is-too-large/16127/4 "2015-01-21T17:52:51Z")

</div>

Hmm, maybe there’s a conflict in your css or an error in your js, are you seeing anything in you console?  
I just tried this with this code

```auto
.controller('MainCtrl', function($scope,$ionicPlatform) {
  $ionicPlatform.ready(function() {
    ionic.Platform.fullScreen();
  });
});

```

And the app worked fine

 ![image](https://global.discourse-cdn.com/ionicframework/original/2X/9/937ccbdb680cc971b36ef38098818b2dc301b146.png)

---

<div class="post-metadata">

**Author:** ![Apavillet](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@Apavillet](https://forum.ionicframework.com/u/Apavillet)\
**Post date:** [January 21, 2015, 6:00pm UTC](https://forum.ionicframework.com/t/ios-header-size-is-too-large/16127/5 "2015-01-21T18:00:43Z")

</div>

Hello,

Sorry I if explained poorly the ionic.Platform.fullScreen() is working fine.

The screenshot I sent is without the fullScreen() and as you can see the header is taller than expected

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [January 21, 2015, 6:06pm UTC](https://forum.ionicframework.com/t/ios-header-size-is-too-large/16127/6 "2015-01-21T18:06:04Z")

</div>

Ahh alright, makes sense now.

Hmm, it maybe some conflicted css classes.  
Any chance you could put together a codepen or post the project on github?

---

<div class="post-metadata">

**Author:** ![Apavillet](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@Apavillet](https://forum.ionicframework.com/u/Apavillet)\
**Post date:** [January 22, 2015, 1:16pm UTC](https://forum.ionicframework.com/t/ios-header-size-is-too-large/16127/7 "2015-01-22T13:16:48Z")

</div>

A codepen would not help since I only see it on device once build as an app.  
The project cannot be posted on github because it’s a private one ☹  
I’ll look into it and come back if I have more informations since I understand it’s hard to help with so few informations.

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [January 22, 2015, 3:15pm UTC](https://forum.ionicframework.com/t/ios-header-size-is-too-large/16127/8 "2015-01-22T15:15:07Z")

</div>

Well [we can make a project from codepen](http://ionicframework.com/blog/live-reload-all-things-ionic-cli/) so that would eliminate that issue.

If you want, send me a PM, you can always send me a copy of the project

---

<div class="post-metadata">

**Author:** ![fredrikstolpe](https://avatars.discourse-cdn.com/v4/letter/f/fbc32d/32.png) [@fredrikstolpe](https://forum.ionicframework.com/u/fredrikstolpe)\
**Post date:** [February 5, 2015, 4:25pm UTC](https://forum.ionicframework.com/t/ios-header-size-is-too-large/16127/9 "2015-02-05T16:25:34Z")

</div>

I have the exact same issue in iOS. Any solution to this one?

Thanks

---

<div class="post-metadata">

**Author:** ![Apavillet](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@Apavillet](https://forum.ionicframework.com/u/Apavillet)\
**Post date:** [February 6, 2015, 9:45am UTC](https://forum.ionicframework.com/t/ios-header-size-is-too-large/16127/10 "2015-02-06T09:45:59Z")

</div>

We ended up customizing the css from ionic ( platform.scss )

---

<div class="post-metadata">

**Author:** ![fredrikstolpe](https://avatars.discourse-cdn.com/v4/letter/f/fbc32d/32.png) [@fredrikstolpe](https://forum.ionicframework.com/u/fredrikstolpe)\
**Post date:** [February 10, 2015, 9:13am UTC](https://forum.ionicframework.com/t/ios-header-size-is-too-large/16127/11 "2015-02-10T09:13:00Z")

</div>

I realized my issue is related to the fact that I am using Phonegap Build. By making changes to config.xml and adding the StatusBar.styleDefault(); script I managed to get it working better, not really sure how. The original statusbar is now hidden and the ios status bar content is on top of my app.

What config.xml to use when using phonegap build is really unclear. Theres no single place for information about this. Some settings is not working, maybe because phongap build has changed

---

<div class="post-metadata">

**Author:** ![sdhull](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sdhull/32/95681_2.png) [@sdhull](https://forum.ionicframework.com/u/sdhull)\
**Post date:** [June 5, 2015, 1:13am UTC](https://forum.ionicframework.com/t/ios-header-size-is-too-large/16127/12 "2015-06-05T01:13:42Z")

</div>

I’m having a similar issue. I’ve updated to the latest version of Ionic, to be sure these aren’t solved issues.

Even when I put the call to `ionic.Platform.fullScreen();` at the end of the `.run` block, the header is still too tall.

```
.run(function($ionicPlatform) {
  $ionicPlatform.ready(function() {
    // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
    // for form inputs)
    if (window.cordova && window.cordova.plugins && window.cordova.plugins.Keyboard) {
      cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
    }
    if (window.StatusBar) {
      // org.apache.cordova.statusbar required
      StatusBar.styleLightContent();
    }

    // make it fullscreen on IOS so it has the correct header size.
    ionic.Platform.fullScreen();
  });
})

```

However, if I run `ionic.Platform.fullScreen();` in Safari developer tools console after the app is completely done booting, the header gets the correct size.

OK so after some more investigation, I found that adding this preference to `config.xml`:

```
<preference name="StatusBarOverlaysWebView" value="false"/>

```

causes that same preference to be added _twice_ to the generated `platforms/ios/build/emulator/MyApp.app/config.xml`, once with a value of `true` and once with a value of `false`. I’m guessing this is possibly the cause of the issue?

Any help would be greatly appreciated!

---

<div class="post-metadata">

**Author:** ![sdhull](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sdhull/32/95681_2.png) [@sdhull](https://forum.ionicframework.com/u/sdhull)\
**Post date:** [June 5, 2015, 1:40am UTC](https://forum.ionicframework.com/t/ios-header-size-is-too-large/16127/13 "2015-06-05T01:40:41Z")

</div>

In fact, `$ionicPlatform.ready(function()` never runs in the emulator at all.

What am I missing here?

---

<div class="post-metadata">

**Author:** ![sdhull](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sdhull/32/95681_2.png) [@sdhull](https://forum.ionicframework.com/u/sdhull)\
**Post date:** [June 5, 2015, 9:27pm UTC](https://forum.ionicframework.com/t/ios-header-size-is-too-large/16127/14 "2015-06-05T21:27:46Z")

</div>

OK apparently I had failed to use the `--save` flag when adding some of the plugins. It’s important that your plugin be declared in `config.xml`, apparently.

While I was at it, I blew away my `platforms/ios` and `plugins` directories for good measure, as well as updated cordova itself & moved from deprecated plugins to more recent versions. All in all, things working better now.

---

<div class="post-metadata">

**Author:** ![sdhull](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sdhull/32/95681_2.png) [@sdhull](https://forum.ionicframework.com/u/sdhull)\
**Post date:** [June 6, 2015, 12:11am UTC](https://forum.ionicframework.com/t/ios-header-size-is-too-large/16127/15 "2015-06-06T00:11:02Z")

</div>

And I’ve verified that even with all-new everything, setting `<preference name="StatusBarOverlaysWebView" value="false"/>` in config.xml causes that preference to show up twice in the generated configs, which breaks things.

---

<div class="post-metadata">

**Author:** ![bobspongieux](https://avatars.discourse-cdn.com/v4/letter/b/b9bd4f/32.png) [@bobspongieux](https://forum.ionicframework.com/u/bobspongieux)\
**Post date:** [June 15, 2015, 10:07am UTC](https://forum.ionicframework.com/t/ios-header-size-is-too-large/16127/16 "2015-06-15T10:07:44Z")

</div>

Exact same issue here, is it possible to get the css that fixed it plz ? (working on android too if possible 😉 )

---

<div class="post-metadata">

**Author:** ![bnawaz168](https://avatars.discourse-cdn.com/v4/letter/b/e5b9ba/32.png) [@bnawaz168](https://forum.ionicframework.com/u/bnawaz168)\
**Post date:** [July 6, 2015, 10:26am UTC](https://forum.ionicframework.com/t/ios-header-size-is-too-large/16127/17 "2015-07-06T10:26:56Z")

</div>

Same issue here also! Headers on iOS are way too tall, have to manually fix in CSS. I’ve set my status bar in config.xml to be solid (I set the overlay property to false also as I wanted this to be separate).

Here are the CSS fixes I wrote to make everything work properly (If you find them useful, some kudos would be nice! 😉 )

```
/*Disabling platform specific tweaks */
.platform-ios.platform-cordova:not(.fullscreen) .bar-header
{
  height: 44px !important;
}
.platform-ios.platform-cordova:not(.fullscreen) .bar-header:not(.bar-subheader)
{
  height: 44px !important;
}

.platform-ios.platform-cordova:not(.fullscreen) .bar-header:not(.bar-subheader).item-input-inset .item-input-wrapper
{
  margin-top: 0px !important;
}

.platform-ios.platform-cordova:not(.fullscreen) .bar-header:not(.bar-subheader) > *
{
  margin-top: 0px !important;
}

.platform-ios.platform-cordova:not(.fullscreen) .tabs-top > .tabs, .platform-ios.platform-cordova:not(.fullscreen) .tabs.tabs-top
{
  top: 44px !important;
}

.platform-ios.platform-cordova:not(.fullscreen) .has-header, .platform-ios.platform-cordova:not(.fullscreen) .bar-subheader
{
  top: 44px !important;
}

.platform-ios.platform-cordova:not(.fullscreen) .has-subheader {
  top: 88px !important;
}
```

---

<div class="post-metadata">

**Author:** ![nghiemnguyen](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/nghiemnguyen/32/93101_2.png) [@nghiemnguyen](https://forum.ionicframework.com/u/nghiemnguyen)\
**Post date:** [October 29, 2015, 4:54pm UTC](https://forum.ionicframework.com/t/ios-header-size-is-too-large/16127/18 "2015-10-29T16:54:35Z")

</div>

thanks @bnawaz168 you saved my time, but i still hope ionic will provide another flexible way on this improvement

---

<div class="post-metadata">

**Author:** ![mirko77](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mirko77/32/137216_2.png) [@mirko77](https://forum.ionicframework.com/u/mirko77)\
**Post date:** [March 1, 2016, 2:48pm UTC](https://forum.ionicframework.com/t/ios-header-size-is-too-large/16127/19 "2016-03-01T14:48:18Z")

</div>

Thanks, this works.  
Apparently Ionic does not cover the case when you want the Status bar to be visible but NOT overlapping the WebView, so the css fix is the only way to do it. Am I right, @mhartington?

---

<div class="post-metadata">

**Author:** ![dario](https://avatars.discourse-cdn.com/v4/letter/d/bc79bd/32.png) [@dario](https://forum.ionicframework.com/u/dario)\
**Post date:** [June 7, 2016, 7:12am UTC](https://forum.ionicframework.com/t/ios-header-size-is-too-large/16127/20 "2016-06-07T07:12:35Z")

</div>

Thanks, it works like a charm!

[Next page](https://forum.ionicframework.com/t/ios-header-size-is-too-large/16127.md?page=2)
