【问题标题】:Ionic 4 Statusbar fully transparentIonic 4 状态栏完全透明
【发布时间】:2020-04-15 09:05:48
【问题描述】:

我正在尝试使我的应用 statusbarandroid 上完全透明
MainActivity.java

上使用此代码
    getWindow().getDecorView().setSystemUiVisibility(
       View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
       View.SYSTEM_UI_FLAG_LAYOUT_STABLE);

app.commponent

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

但仍不完全透明

【问题讨论】:

  • 检查已编辑的答案

标签: ionic-framework ionic4


【解决方案1】:

app.component.ts

ionViewWillEnter() {
  this.statusBar.show();
  this.StatusBar.overlaysWebView(true);
  this.StatusBar.backgroundColorByHexString('#000000');
}

【讨论】:

  • 我已经在 config.xml 中定义了这个,但结果还是一样
  • 定义如下: -
  • 嗯,变黑了!!
  • 只是想知道您的HexString 是否接受像 '#00000000' 这样的 alpha 通道?
  • 它接受#11000000,会是上面截图的结果,但是当它是#00000000时它应该是完全透明的,但是它变成了黑色
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2022-08-09
  • 2021-02-26
  • 2016-10-27
  • 1970-01-01
  • 2023-03-29
  • 2022-11-28
相关资源
最近更新 更多