[英]Apple touch icon not working
I am writing an html5 game, and trying to get an apple touch icon to work. 我正在编写html5游戏,并尝试使苹果触摸图标正常工作。 I am testing on a non-retina iPhone 4S running ios5. 我正在运行iOS5的非视网膜iPhone 4S上进行测试。 The first part of my html file is: 我的html文件的第一部分是:
<head>
<title>My Game</title>
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />
<meta name="viewport" content="user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="apple-touch-icon" href="img/apple-touch-icon.png"/>
I am also using a script to prompt users to add the touch icon; 我还使用脚本来提示用户添加触摸图标; this script shows a preview of the touch icon, and it finds the icon with no problem. 该脚本显示了触摸图标的预览,并且可以毫无问题地找到该图标。 Also, the icon is public , not password-protected. 此外,该图标是公开的 ,没有密码保护。
When I add the shortcut to my home screen, I get the simple screenshot icon. 当我将快捷方式添加到主屏幕时,我得到了简单的屏幕截图图标。 I have tried clearing my history and cache. 我试图清除我的历史记录和缓存。 Am I doing something wrong? 难道我做错了什么? Are those no-cache meta tags interfering with the icon? 那些无缓存元标记会干扰图标吗? (They are there so I don't have to worry about caching issues while developing.) (它们在那里,所以我在开发时不必担心缓存问题。)
The issue came down to the fact that my hosting provider does not allow hotlinking of images. 问题归结为我的托管服务提供商不允许图像的热链接。 So I set up an account at imgur.com, hosted the touch icon there, and it works. 因此,我在imgur.com上建立了一个帐户,并在该帐户中托管了触摸图标,并且该方法可以正常工作。 I was happy to see that an externally-hosted touch icon works. 我很高兴看到外部托管的触摸图标有效。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.