【发布时间】:2016-12-17 20:27:32
【问题描述】:
所以我正在 iFraming 另一个站点,我希望我的用户将该站点添加到主屏幕并从那里使用它。但是当我尝试使用其他网站的代码时,它不起作用。
【问题讨论】:
标签: javascript html web-applications mobile-safari
所以我正在 iFraming 另一个站点,我希望我的用户将该站点添加到主屏幕并从那里使用它。但是当我尝试使用其他网站的代码时,它不起作用。
【问题讨论】:
标签: javascript html web-applications mobile-safari
在您的index.html 文件的<head> 中包含这些元标记。在 iOS 上,这将模拟一个可以添加到主屏幕的 web 应用程序。
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-title" content="AppTitle">
<link rel="apple-touch-icon" href="/custom_icon.png">
<link rel="apple-touch-icon" sizes="152x152" href="touch-icon-ipad.png">
<link rel="apple-touch-icon" sizes="180x180" href="touch-icon-iphone-retina.png">
<link rel="apple-touch-icon" sizes="167x167" href="touch-icon-ipad-retina.png">
<link rel="apple-touch-startup-image" href="/launch.png">
为了使每个设备的图标和启动图像正确加载,您的图像必须具有下面链接的 Apple 用户界面指南中描述的确切尺寸。如果图像未指定这些尺寸,则不会加载。
此 Gist 还显示了所有可用的元标记:https://gist.github.com/tfausak/2222823
【讨论】: