Ionic - Change application bar top color

1

Hello, I'm developing an application with Ionic3 and when I start the application in the emulator runs cool, however it is common in applications the black bar stay in the color of the header but in a darker tone. How to do this?

Anotherthing,whenIsimulateiOS,theupperbarisovertheelementsoftheapplication,howtofixit?

    
asked by anonymous 03.08.2018 / 17:04

1 answer

3

You can change the color of the top bar and fix the bar in IOS with the cordova-plugin-statusbar plugin. Include in config.xml the StatusBarOverlaysWebView property to change color and StatusBarOverlaysWebView to false so that the top menu is not over your app in IOS.

Install the plugin:

ionic cordova plugin add cordova-plugin-statusbar
npm install --save @ionic-native/status-bar

Include in app.module.ts:

import { StatusBar } from '@ionic-native/status-bar';
...
providers: [
  StatusBar,
...

Include in config.xml:

<platform name="android">
    <preference name="StatusBarBackgroundColor" value="#000000" />
</platform>

<platform name="ios">
    <preference name="StatusBarOverlaysWebView" value="false" />
    <preference name="StatusBarBackgroundColor" value="#000000" />
</platform>
    
03.08.2018 / 17:26