苹果端保存到桌面代码:(注意尺寸是57x57)
试了一下发现安卓端用浏览器打开保存到桌面后图标显示不了,(chrome和UC)都不行。但是看了哔哩哔哩网站上的可以。
安卓端于是多了一行代码:
manifest.json文件内容如下(直接复制哔哩哔哩的):
{
"name": "哔哩哔哩web版",
"short_name" :"bilibili",
"start_url": "index.html",
"display": "standalone",
"orientation": "portrait",
"theme_color": "#de698c",
"background_color": "#fff",
"icons": [{
"src": "//s1.hdslb.com/bfs/static/mult/images/app_logo.png@36w_36h.png",
"sizes": "36x36",
"type": "image/png"
}, {
"src": "//s1.hdslb.com/bfs/static/mult/images/app_logo.png@48w_48h.png",
"sizes": "48x48",
"type": "image/png"
}, {
"src": "//s1.hdslb.com/bfs/static/mult/images/app_logo.png@72w_72h.png",
"sizes": "72x72",
"type": "image/png"
}, {
"src": "//s1.hdslb.com/bfs/static/mult/images/app_logo.png@96w_96h.png",
"sizes": "96x96",
"type": "image/png"
}, {
"src": "//static.hdslb.com/mobile/img/512.png",
"sizes": "144x144",
"type": "image/png"
}, {
"src": "//static.hdslb.com/mobile/img/512.png",
"sizes": "192x192",
"type": "image/png"
}, {
"src": "//static.hdslb.com/mobile/img/512.png",
"sizes": "256x256",
"type": "image/png"
}, {
"src": "//static.hdslb.com/mobile/img/512.png",
"sizes": "512x512",
"type": "image/png"
}],
"permissions": {
"desktop-notification": {
"description": "Needed for creating system notifications."
}
}
}
看了一下他们需要适应不同的手机屏幕,所以就有不同的尺寸。 |
|