简体   繁体   English

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

I have this in my index.html file : 我的index.html文件中有此文件:

<!-- WEB SEARCH META TAGS -->
    <meta charset="utf-8">
    <meta name="robots" content="index,follow" />
    <meta name="keywords" content="surfboards,surfboard,shaper,surfing,app,boards,board" />
    <meta name="description" content="" />
    <meta name="author" content="BoardLine Cie">
    <link rel="shortcut icon" href="images/apple-touch-icon-57x57-precomposed.png" />

    <!-- SAFARI WEB APP META TAGS -->
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <meta name="apple-mobile-web-app-title" content="BoardLine">
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">

    <!-- CSS-->
    <link rel="stylesheet" href="css/jquery.mobile-1.3.2.css" type="text/css" media="all" />
    <link rel="stylesheet" href="css/style.css" type="text/css" media="all" />

    <!-- iPhone + Android -->
    <link rel="apple-touch-icon" sizes="60x60" href="images/apple-touch-icon.png"/>
    <link rel="apple-touch-startup-image" media="(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 1)" href="images/apple-touch-startup-image320x460.png">
    <link rel="apple-touch-icon-precomposed" href="images/apple-touch-icon-57x57-precomposed.png" />

    <!-- iPhone (Retina) -->
    <link rel="apple-touch-icon" sizes="120x120" href="images/apple-touch-icon-120x120.png">
    <link rel="apple-touch-startup-image" media="(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 2)" href="images/apple-touch-startup-image640x920.png">

    <!-- iPhone 5 -->
    <link rel="apple-touch-startup-image" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)" href="images/apple-touch-startup-image640x1096.png">

    <!-- iPad -->
    <link rel="apple-touch-icon" sizes="76x76" href="images/apple-touch-icon-76x76.png">
    <link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 1)" href="images/apple-touch-startup-image768x1004.png">
    <link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 1)" href="images/apple-touch-startup-image748x1024.png">

    <!-- iPad (Retina) -->
    <link rel="apple-touch-icon" sizes="152x152" href="images/apple-touch-icon-152x152.png">
    <link href="img/splash/ios/splash1536x2008.png" media="(device-width: 768px) and (device-height: 1024px)    and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">
    <link href="img/splash/ios/splash1496x2048.png" media="(device-width: 768px) and (device-height: 1024px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">

The files are in the root folder, whose access is restricted by a .htaccess (for testing purposes). 这些文件位于根文件夹中,该文件夹的访问受.htaccess限制(出于测试目的)。

All png fils have the pixel dimensions indicated in the file name. 所有png文件都具有文件名中指示的像素尺寸。

But android (4.1.2 in my case) keeps using a standard icon for the home-screen shortcut (an orange picture)... Doesn't work on iphone4 neither. 但是android(在我的情况下为4.1.2)一直在使用标准图标作为主屏幕快捷方式(橙色图片)...在iphone4上也不起作用。

Can you help me figure out what is wrong ? 你能帮我弄清楚哪里出了问题吗?

thanks 谢谢

Google似乎不再支持apple-touch-icon语法。

rel="apple-touch-icon" is deprecated in favor of rel="shortcut icon" but still supported as of Chrome 33. 不推荐使用rel="apple-touch-icon"而推荐使用rel="shortcut icon"但从Chrome 33开始仍受支持。

In your example you have both, so it should work. 在您的示例中,您同时拥有两者,因此应该可以使用。 However, it looks like the stock browser on some Android devices is not capable of using custom icon on home screen. 但是,某些Android设备上的常规浏览器似乎无法在主屏幕上使用自定义图标。

I experience the same on a Samsung Galaxy Note 3 with Android 4.3. 我在装有Android 4.3的Samsung Galaxy Note 3上也遇到了同样的情况。 Chrome will use the custom icon, but the stock browser will only use that orange generic icon. Chrome将使用自定义图标,但是常规浏览器将仅使用该橙色通用图标。

User Agent for Chrome on my Samsung Galaxy Note 3 is: 我的Samsung Galaxy Note 3上的Chrome用户代理为:

"Mozilla/5.0 (Linux; Android 4.3; SM-N9005 Build/JSS15J) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.136 Mobile Safari/537.36"

User Agent for the stock browser is: 股票浏览器的用户代理是:

"Mozilla/5.0 (Linux; Android 4.3; nb-no; SAMSUNG SM-N9005 Build/JSS15J) AppleWebKit/537.36 (KHTML, like Gecko) Version/1.5 Chrome/28.0.1500.94 Mobile Safari/537.36"

which looks to be a Samsung packaged older version of Chrome (v28)? 哪个看起来像是三星包装的旧版Chrome(v28)? If Chrome didn't support custom home screen icon before v31 that could probably explain why it doesn't work. 如果Chrome在v31之前不支持自定义主屏幕图标,则可能可以解释为什么它不起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 重复请求apple-touch-icon-precomposed.png,并在头部设置了apple-touch-icon - Repeated Requests for apple-touch-icon-precomposed.png with apple-touch-icon set in head Android 主屏幕应用程序图标与不需要的迷你图标徽章 - Android Home Screen App Icon With Unwanted Mini-Icon Badge 使用LauncherShortcuts在主屏幕上显示Android App图标 - Android App Icon on Home Screen using LauncherShortcuts 科尔多瓦android应用程序不显示主屏幕上的图标 - Cordova android app not showing icon on home screen 是什么导致Android平板电脑上的apple-touch-icon.png 404 - What is causing apple-touch-icon.png 404 on android tablet Android隐藏的应用程序图标出现在主屏幕上 - Android hidden app icon appear on home screen Android 4.4 HTML apple-touch-icon无法正常工作? - Android 4.4 HTML apple-touch-icon not working? 从Apple Store安装应用程序是否会自动创建主屏幕快捷方式图标? - Do app installs from the Apple Store automatically create a home screen shortcut icon? 为什么android chrome使用apple-touch-icon而不是清单中指定的内容添加到主屏幕? - Why is android chrome add to homescreen using apple-touch-icon instead of what's specified in my manifest? Android应用程序主屏幕图标显示默认的android图标? - Android application home screen icon showing default android icon?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM