代码之家  ›  专栏  ›  技术社区  ›  Ali H

如何在Ionic 2中使状态栏颜色可变

  •  3
  • Ali H  · 技术社区  · 8 年前

    enter image description here

    enter image description here

    2 回复  |  直到 8 年前
        1
  •  5
  •   Alex Pappas    8 年前

    https://ionicframework.com/docs/native/status-bar/

    要改变颜色,你可以试穿一下 ,在您的 建造师

    (假设您已注射 statusBar: StatusBar 在您的ctor上)

    this.statusBar.backgroundColorByHexString('#ffffff');
    

    this.statusBar.styleBlackOpaque()
    //or
    this.statusBar.styleBlackTranslucent()
    

        2
  •  2
  •   SANJEEV yadav    7 年前

    带代码的答案

    //set top status bar overlay
    statusBar.overlaysWebView(true);
    // set status bar to red
    statusBar.backgroundColorByHexString('#f00');
    

    http://www.jawabadda.com/pages/technical-guru/how-to-change-color-top-status-bar-in-ionic/