iOS WebApp 不显示启动图像

标签 ios html 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">

在我网站的 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/

相关文章:

ios - UIView:在显示之前调用了哪个方法?

ios - 无法约束将 UIView 固定到单元格 contentView 的底部

iphone - iAd 断网后刷新

javascript - Img Src 或 data-imgsrc Coldfusion

reactjs - 在 Safari 中输入更改订单位置

ios - Titanium scrollableView

javascript - 如何使用 jquery 和 css3 在移动设备上实现 *SMOOTH* 淡入淡出动画?

jquery - bootstrap - tabbable,左边的标签根本不起作用

框阴影颜色函数中的 CSS 自定义属性在 Safari 中呈现不正确

cocoa - 在 safari 中重新加载网页或打开新网页时将调用哪些方法和类