2

I have been trying to change status bar color in Ionic App with the following method:

 import { StatusBar } from '@ionic-native/status-bar';

 constructor(private statusBar: StatusBar) { }

 this.statusBar.overlaysWebView(true);

 this.statusBar.backgroundColorByHexString('#ffffff');

But still the status bar color doesn't change.

2 Answers 2

8

Finally found the solution after days of searching. First install

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

then add the following to the config.xml

<preference name="StatusBarBackgroundColor" value="#2873ed" />
<preference name="StatusBarOverlaysWebView" value="true" />
0
4

Installation

Install the Cordova and Ionic Native plugins:

$ ionic cordova plugin add cordova-plugin-statusbar
$ npm install --save @ionic-native/status-bar@4 // @4 for ionic 3

Usage

import { StatusBar } from '@ionic-native/status-bar';

constructor(private statusBar: StatusBar) { }

...

// let status bar overlay webview
this.statusBar.overlaysWebView(true);

// set status bar to white
this.statusBar.backgroundColorByHexString('#ffffff');

see ionic 3 status bar

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.