【发布时间】:2016-07-25 18:55:05
【问题描述】:
在这些演示中,初始屏幕上有徽标。
https://addyosmani.com/blog/getting-started-with-progressive-web-apps/
我不知道我在清单中做错了什么 - 我有一个图标,但它没有显示在我的初始屏幕上。
我的清单如下所示:
{
"short_name": "Weather Service",
"name": "Weather Service",
"icons": [
{
"src": "logo.png",
"sizes": "144x144",
"type": "image/png"
}
],
"start_url": "index.html",
"display": "standalone",
"orientation": "portrait",
"background_color": "#FAFAFA",
"theme_color": "#512DA8"
}
我需要超过 1 张图片才能显示在启动画面上吗?
【问题讨论】:
-
这可能与您放置图像文件的确切路径/目录有关。路径是否正确?
-
logo.png 被正确读取为图标(网络应用程序图标 - 添加到主屏幕时),但它不会出现在启动屏幕上。路径正确。
-
您的清单上只能有一个徽标,例如:incredibleweb.github.io/samples/web-application-manifest/… 添加到 HomeScreen 后效果很好。我建议检查图像路径、大小和 MIME 类型。有链接吗?
标签: icons manifest splash-screen progressive-web-apps