如何为我的网站提供iPhone图标?
时间:2020-03-05 18:37:36 来源:igfitidea点击:
如何设置我创建的网站在iPhone上显示的图标?
解决方案
回答
从Apple Developer Connection iPhone版Safari Web内容指南页面指定Web剪辑的网页图标...
The user can add a web application or webpage link to the Home screen. These links, represented by an icon, are called web clips. Follow these simple steps to specify an icon to represent your web application or webpage on iPhone. To specify an icon for the entire website (every page on the website), place an icon file in PNG format in the root document folder called apple-touch-icon.png. To specify an icon for a single webpage, or replace the website icon with a webpage-specific icon, add a link element to the webpage as in: <link rel="apple-touch-icon" href="/custom_icon.png"/> In the above example, replace custom_icon.png with your icon filename. See "Create an Icon for Your Web Application or Webpage" in iPhone Human Interface Guidelines in iPhone Human Interface Guidelines for webpage icon metrics. Note: The web clip feature is available in iPhone 1.1.3 and later.
回答
为了完整起见,链接到Scott Hanselman的文章,其中还包含一些其他提示:
添加主屏幕iPhone图标并调整ViewPort
回答
我建议Stack Overflow实现一个apple-touch-icon:
在iPhone上为Safari添加苹果触摸图标
回答
请参阅Safari参考资料库中Safari Web内容指南的"配置Web应用程序"页面的"指定Web剪辑的网页图标"部分。
Specifying a Webpage Icon for Web Clip iPhone OS Note: The Web Clip feature is available in iPhone OS 1.1.3 and later. The apple-touch-icon-precomposed.png filename is available in iPhone OS 2.0 and later.
我们可能希望用户能够添加
Web应用程序或者网页链接
到主屏幕。这些链接,
用图标表示的称为Web
剪辑。请按照以下简单步骤操作
指定一个图标代表网站
iPhone OS上的应用程序或者网页。
- 要为整个网站(网站的每个页面)指定一个图标,请将PNG格式的图标文件放置在名为
apple-touch-icon.png
或者`apple-touch-icon-precomposed.png'的根文档文件夹中。 。如果我们使用" apple-touch-icon-precomposed.png"作为文件名,则iPhone OS上的Safari不会在图标上添加任何效果。 - 要为单个网页指定图标或者将网站图标替换为特定于网页的图标,请向网页添加链接元素,如:<link rel =" apple-touch-icon" href =" / custom_icon.png " />"在上面的示例中,将" custom_icon.png"替换为图标文件名。如果我们不希望Safari在iPhone OS上给图标添加任何效果,请用" apple-touch-icon-precomposed"替换" apple-touch-icon"。
有关网页图标指标的信息,请参阅《 iPhone Web界面人机界面指南》中的"为Web应用程序或者网页创建图标"。