Cordova 离子4:状态栏溢出内容问题

Cordova 离子4:状态栏溢出内容问题,cordova,ionic-framework,statusbar,Cordova,Ionic Framework,Statusbar,我的应用程序有点问题,StatusBar无法正常显示,如您所见: 我用StatusBar插件声明了StatusBar: 在app.component.ts中 this.statusBar.overlaysWebView(true); this.statusBar.show(); initializeApp() { this.platform.ready().then(() => { this.statusBar.overlaysWebView(true);

我的应用程序有点问题,
StatusBar
无法正常显示,如您所见:

我用
StatusBar插件
声明了
StatusBar

在app.component.ts中

this.statusBar.overlaysWebView(true);
this.statusBar.show();
initializeApp() {
    this.platform.ready().then(() => {
      this.statusBar.overlaysWebView(true);
      this.splashScreen.hide();
    });
  }
ionViewWillEnter() {
    this.statusBar.overlaysWebView(false); 
    this.statusBar.show();
  }
我可以为我所有的
页面和
菜单设置自定义的
填充顶部吗?
还是显示
状态栏的方法正确?

方法1 您可以将填充顶部添加到
离子工具栏
内部变量.scss

this.statusBar.overlaysWebView(true);
this.statusBar.show();
initializeApp() {
    this.platform.ready().then(() => {
      this.statusBar.overlaysWebView(true);
      this.splashScreen.hide();
    });
  }
ionViewWillEnter() {
    this.statusBar.overlaysWebView(false); 
    this.statusBar.show();
  }
方法2 您可以更改状态栏的颜色,指定与标题颜色相同的颜色

      this.statusBar.overlaysWebView(false)
      this.statusBar.styleDefault();
      this.statusBar.styleLightContent(); //Status bar color, light if you have dark header
      this.statusBar.backgroundColorByHexString('HERE YOUR CUSTOM COLOR VALUE');

应用程序组件.ts

this.statusBar.overlaysWebView(true);
this.statusBar.show();
initializeApp() {
    this.platform.ready().then(() => {
      this.statusBar.overlaysWebView(true);
      this.splashScreen.hide();
    });
  }
ionViewWillEnter() {
    this.statusBar.overlaysWebView(false); 
    this.statusBar.show();
  }
页面。ts

this.statusBar.overlaysWebView(true);
this.statusBar.show();
initializeApp() {
    this.platform.ready().then(() => {
      this.statusBar.overlaysWebView(true);
      this.splashScreen.hide();
    });
  }
ionViewWillEnter() {
    this.statusBar.overlaysWebView(false); 
    this.statusBar.show();
  }

你知道我能设定什么值吗?取决于平台和屏幕大小?我可以告诉你这是正确的方法。但是如果您想保留这个.statusBar.overlyswebview(true);我的方法行不通。编辑我的答案…我有一种情况,它只在应用程序打开时工作,当我关闭应用程序而不关闭时,我看不到状态栏