【问题标题】:How to change the color of the status bar in chrome on android with a dark theme?如何在带有深色主题的android上更改chrome中状态栏的颜色?
【发布时间】:2021-09-19 03:37:21
【问题描述】:

我遇到了这样的问题 - 尽管有清单和元标记,但当我为 android 启用深色主题时,我的网站上方的状态栏不会变成所需的颜色(黑色),但始终保持灰色。使用浅色主题时,问题就消失了。任何人都可以遇到类似的并知道如何解决它吗?

元标记

<meta name="theme-color" content="#000000" />

manifest.json 的一部分

{
    "theme_color": "#000000",
    "background_color": "#000000"
}

以下是深色和浅色主题的照片:

Dark theme, status bar for some reason gray

Light theme, status bar black, as it should be

【问题讨论】:

    标签: html google-chrome progressive-web-apps statusbar manifest.json


    【解决方案1】:

    可以解决您的问题

    1. 在会话/浏览器 cookie 中保存颜色并更改 HTML 颜色值

    2. 更改 manifest.json 文件(在服务器上) - 但这不是一个好主意,因为 manifest.json 已缓存(通常他们会更新它24 hours

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-09
      • 1970-01-01
      • 1970-01-01
      • 2016-07-06
      • 2014-04-07
      • 1970-01-01
      相关资源
      最近更新 更多