iOS WebApp未显示启动图像

Mat*_*own 5 safari html5 ios 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">
Run Code Online (Sandbox Code Playgroud)

在我的网站的头标记之间,但它不适用于启动图像这是正常的吗?

Fin*_*ney 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">
Run Code Online (Sandbox Code Playgroud)

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

此类工具之一是http://ticons.fokkezb.nl/