简体   繁体   English

苹果触摸图标不起作用

[英]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.

相关问题 适用于iPhone 7的Apple Touch图标(主屏幕图标)吗? - Apple Touch Icon (Homescreen icon) for iPhone 7? 将apple-touch-icon添加到我的应用程序(从图像文件)不起作用 - Add apple-touch-icon to my application (from image file) not working 是否可以使用apple-touch-icon作为网站图标? - is using apple-touch-icon as favicon possible? Web应用程序的苹果触摸图标/主屏幕图标单击事件 - apple touch icon/home screen icon click event for web app 梳理“icon”和“apple-touch-icon”链接类型 - Combinging “icon” and “apple-touch-icon” link types android,主屏幕上的Web应用程序图标,而不是常规图标,apple touche图标:apple-touch-icon-precomposed - android, web app icon on the home screen instead of generic icon, apple touche icon : apple-touch-icon-precomposed 验证错误“元素链接上属性 rel 的错误值 apple-touch-icon-precomposed:未注册关键字 apple-touch-icon-precomposed。” - Validation error “Bad value apple-touch-icon-precomposed for attribute rel on element link: Keyword apple-touch-icon-precomposed is not registered.” 我的网站已因Apple-touch-icon.png的请求而关闭? - My Sites Have Been Shut Down for Apple-touch-icon.png requests? sencha touch tabpanel标签的图标 - Icon for sencha touch tabpanel tabs 触摸事件不起作用EaselJS - Touch events not working EaselJS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM