我加了
<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">
在我网站的 head 标签之间 但它不适用于启动图像 这正常吗?
最佳答案
您是否尝试在桌面浏览器中查看启动图像?如果是这样,那么我会在 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/
关于iOS WebApp 不显示启动图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36430982/