【问题标题】:Manifest theme/background-color清单主题/背景色
【发布时间】:2017-12-30 11:25:52
【问题描述】:

在我的 manifest.json 文件中,我设置了我的主题颜色和背景颜色

{
    "name": "Friends",
    "short_name": "Friends",
    "icons": [
        {
            "src": "/src/images/icons/friends-b-icon-48x48.png",
            "type": "image/png",
            "sizes": "48x48"
    },
        {
            "src": "/src/images/icons/friends-b-icon-144x144.png",
            "type": "image/png",
            "sizes": "144x144"
    },
        {
            "src": "/src/images/icons/friends-b-icon-256x256.png",
            "type": "image/png",
            "sizes": "256x256"
    },
        {
            "src": "/src/images/icons/friends-b-icon-512x512.png",
            "type": "image/png",
            "sizes": "512x512"
    }

  ],
    "start_url": "/index.html",
    "scope": ".",
    "display": "standalone",
    "orientation": "portrait-primary",
    "background-color": "#795548",
    "theme-color": "#795548",
    "description": "Share your moments with your friends",
    "dir": "ltr",
    "lang": "en-US"
}

但是当我在 Chrome 中查看时,它们消失了

有谁知道如何解决这个问题? 提前谢谢!

【问题讨论】:

    标签: manifest manifest.json


    【解决方案1】:

    在manifest.json 中,属性名称使用_ 作为分隔符,而不是-。 您必须将background-color 更改为background_color 并将theme-color 更改为theme_color。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-07-31
      • 2018-06-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多