iOS WebApp未显示启动图像

时间:2016-04-05 15:38:22

标签: ios html5 safari iphone-standalone-web-app

我添加了

<link rel="apple-touch-icon" href="favicon.png" />
<link rel="apple-touch-startup-image" href="splash-screen.png"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black">

我网站的头标记之间 但它对启动图像不起作用 这是正常的吗?

2 个答案:

答案 0 :(得分:1)

您是否尝试在桌面浏览器中查看启动图像?如果是这样,那么我将在IOS移动设备上访问您的网站,并将该应用程序添加到您的主屏幕。当你打开它时,你应该看到闪屏。

不同屏幕尺寸的启动画面也很棘手。您可以使用以下代码来确保它有效。

        <!-- IOS Touch Icons -->
        <link href="apple-touch-icon-57x57.png" sizes="57x57" rel="apple-touch-icon">

        <link href="apple-touch-icon-72x72.png" sizes="72x72" rel="apple-touch-icon">

        <link href="apple-touch-icon-114x114.png" sizes="114x114" rel="apple-touch-icon">
        <link href="apple-touch-icon-144x144.png" sizes="144x144" rel="apple-touch-icon">

        <!-- iOS Startup images -->
        <link href="apple-touch-startup-image-320x460.png" media="(device-width: 320px)" rel="apple-touch-startup-image">
        <link href="apple-touch-startup-image-640x920.png" media="(device-width: 320px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">
        <link href="apple-touch-startup-image-768x1004.png" media="(device-width: 768px) and (orientation: portrait)" rel="apple-touch-startup-image">
        <link href="apple-touch-startup-image-748x1024.png" media="(device-width: 768px) and (orientation: landscape)" rel="apple-touch-startup-image">
        <link href="apple-touch-startup-image-1536x2008.png" media="(device-width: 1536px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">
        <link href="apple-touch-startup-image-2048x1496.png" media="(device-width: 1536px)  and (orientation: landscape) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">

生成所有这些图像非常繁琐,因此我会使用工具自动生成不同的图标和启动屏幕图像。

其中一个工具是http://ticons.fokkezb.nl/

答案 1 :(得分:1)

自iOS 9以来,此功能似乎已被破坏。

虽然没有任何官方用语,但thread(以及Apple没有回应)表明这可能是一个错误。

官方documentation(最后更新于2016年12月)仍然列出 apple-touch-startup-image 功能,希望最终能够修复。