关于PWA启动画面,人们认为在https://pwa-splash.now.sh/和https://medium.com/@applification/progressive-web-app-splash-screens-80340b45d210上的代码是最新且兼容设备的方式吗?还是有人发现了问题并进行了修改?
以下是代码:
以下行需要添加以适应横向屏幕吗?
以下是代码:
<link rel="apple-touch-startup-image" href="images/splash/launch-640x1136.png" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)">
<link rel="apple-touch-startup-image" href="images/splash/launch-750x1294.png" media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)">
<link rel="apple-touch-startup-image" href="images/splash/launch-1242x2148.png" media="(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)">
<link rel="apple-touch-startup-image" href="images/splash/launch-1125x2436.png" media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)">
<link rel="apple-touch-startup-image" href="images/splash/launch-1536x2048.png" media="(min-device-width: 768px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait)">
<link rel="apple-touch-startup-image" href="images/splash/launch-1668x2224.png" media="(min-device-width: 834px) and (max-device-width: 834px) and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait)">
<link rel="apple-touch-startup-image" href="images/splash/launch-2048x2732.png" media="(min-device-width: 1024px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait)">
更新 1:
针对下面 Robinyo 的回答,就上述第一个例子作出回应:
<link rel="apple-touch-startup-image" href="images/splash/launch-640x1136.png" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)">
以下行需要添加以适应横向屏幕吗?
<link rel="apple-touch-startup-image" href="images/splash/launch-**1136x640**.png" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: **landscape**)">
也许我错了,但我不确定 iOS PWA 是否能够处理它。原因是因为我阅读到在创建应用(添加到主屏幕)时,iOS 会选择一张 png 并将其存储在本地。因此下次打开 PWA 应用程序时,它会先使用该本地图像,然后再尝试连接到网络。所以我想知道的问题是,iOS 是否会在本地存储两个图像,一个是竖屏的,一个是横屏的。