How to change StatusBar color in ionic 2

There seems to be a problem on Ionic 2 . It doesn’t seem to be possible to change the StatusBar color, in some custom ROM like MIUI , the statusbar¬†always appears black with white text. How to force ionic to change statusbar color?

Here the answer from my brother, tommy pradana

constructor(public platform: Platform) {
        if ( this.platform.is('android') ) {
            this.platform.ready().then(() => {
                // Okay, so the platform is ready and our plugins are available.
                // Here you can do any higher level native things you might need.
                Splashscreen.hide();
                StatusBar.overlaysWebView(false);
                StatusBar.backgroundColorByHexString('#00FFFF');
            });
        }
    }

or you could use this code below


if (cordova.platformId == 'android') {
    StatusBar.backgroundColorByHexString("#333");
}

And dang…. it will force statusbar color to change based on your code. So, let’s coding again
ref

Leave a Reply

Your email address will not be published. Required fields are marked *