Hi, I am know to Ionic and I am trying to add a color to the status bar. I already downloaded cordova’s plugin and the status bar package from npm. I checked config.xml and the plugin is there. I already changed the overlayWebView to true and to false to see what happened and tried to change the color of the status bar. But nothing has worked. Here’s my code:
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams, Platform } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
@IonicPage()
@Component({
selector: 'page-welcome',
templateUrl: 'welcome.html',
})
export class WelcomePage {
constructor(public navCtrl: NavController, public navParams: NavParams, public statBar: StatusBar, public platform: Platform) {
this.platform= platform;
this.platform.ready().then( () => {
this.statBar.overlaysWebView(true);
this.statBar.backgroundColorByHexString('#ffffff');
});
}
ionViewDidLoad() {
console.log('ionViewDidLoad WelcomePage');
}
}
I would be very grateful if anyone could tell me why this is not working. Thanks in advance.