无法使用IONIC 5在Android中更改状态栏颜色

问题描述 投票:0回答:1

我的应用程序在IONIC 5中,并且我正在使用以下代码更改app.component.ts file中状态栏的颜色。

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

export class AppComponent {

  constructor(
    ...
    private statusBar: StatusBar
    ...
  ) {
    this.initializeApp();
  }

  initializeApp() {
      ...
      this.statusBar.styleDefault();
      this.statusBar.backgroundColorByHexString('#ffffff');
      ...
  }
}

似乎IOS会自动更改与工具栏匹配的状态栏颜色,即使我未在代码中进行更改,但对于Android,状态栏颜色始终为黑色且未更改。

android ionic-framework colors statusbar ionic5
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.