在 manifest.json
中有多种尺寸示例
{ “src”:”images/icons/apple-icon-57x57.png”,
“type”: “image/png”,
“sizes”: “57x57”,
}
在 index.html
中的链接如下所示
<link rel="apple-touch-icon" href=“%PUBLIC_URL%images/icons/apple-
icon-57x57.png" sizes="57x57" />
图标文件位于public/images/icons
中。
最佳答案
不确定您是否仍在寻找答案,但这可能对其他人有帮助;您不需要自动关闭链接标记,因为您的 index.html
不是 JSX 文件。
所以<link rel="apple-touch-icon" sizes="57x57" href=“%PUBLIC_URL%images/icons/apple-icon-57x57.png">
应该可以解决问题。
关于javascript - 无法添加主屏幕图标来创建 React 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50404475/