有什么方法可以通过正确的代码来区分iPhone上的“添加主屏幕”图标和“添加书签/收藏夹”图标?

时间:2019-12-09 13:45:52

标签: ios mobile-safari apple-touch-icon

我想为iPhone上的“添加主屏幕”图标和“添加书签/收藏夹”图标添加不同的图标。 我已经阅读了很多有关此问题的文档,但找不到如何实现此目的。

我从Apple开发人员网站上找到了一些链接,但是它没有告诉我问题

https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html

为此, 我需要在head标签中配置apple-touch-icon链接吗?

...
<link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-57x57-precomposed.png">
<link rel="apple-touch-icon" sizes="60x60" href="/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="60x60" href="/apple-touch-icon-60x60-precomposed.png">
<link rel="apple-touch-icon" sizes="72x72" href="/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="72x72" href="/apple-touch-icon-72x72-precomposed.png">
<link rel="apple-touch-icon" sizes="76x76" href="/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="76x76" href="/apple-touch-icon-76x76-precomposed.png">
<link rel="apple-touch-icon" sizes="114x114" href="/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="114x114" href="/apple-touch-icon-114x114-precomposed.png">
<link rel="apple-touch-icon" sizes="120x120" href="/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="120x120" href="/apple-touch-icon-120x120-precomposed.png">
<link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-144x144-precomposed.png">
<link rel="apple-touch-icon" sizes="152x152" href="/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="152x152" href="/apple-touch-icon-152x152-precomposed.png">
...
</head>

尽管我是这样配置的,但如果根文件夹上有一个名为apple-touch-icon-120x120.png的文件,则会从ROOT文件夹中获取“收藏夹”图标。这是我的问题的其他问题。我的主要问题是如何通过代码区分主屏幕图标和书签/收藏夹?

0 个答案:

没有答案