How to hide the status bar for a particular screen

I’m trying to hide the statusbar and make the content fullscreen but it doesn’t seem to work.

in appcomponent.ts .

//for most pages
if (core.isPlatform(OsType.CORDOVA)) {
        this.statusBar.styleLightContent();
        this.statusBar.overlaysWebView(false);
        this.statusBar.backgroundColorByHexString('#0076b2');
 }

code:
in page.ts

//for specific page
 ionViewDidLoad() {
    this.slides.lockSwipes(true);
    if (this.core.isPlatform(OsType.CORDOVA)) {
      this.statusBar.hide();
      this.statusBar.overlaysWebView(true);
    }
  }

  ionViewWillLeave() {
    if (this.core.isPlatform(OsType.CORDOVA)) {
      this.statusBar.show();
      this.statusBar.overlaysWebView(false);
    }
  }

my result is always with the blue Statusbar visible: