恢弘志士之气,不宜妄自菲薄。这篇文章主要讲述[PWA] Customize the Splash Screen of a PWA built with create-react-app相关的知识,希望能为你提供帮助。
android displays a splash screen for PWAs based on the icons and names you provide, but ios just displays a solid color splash screen for installed PWAs by default.
We\'ll make a new splash screen image for every iOS device resolution size that we want to support, and then we can make a
link
tag in
index.html
to specify those images as the splash screen for each device resolution.
Also, make sure to remove
background_color
from the manifest - or it may overwrite the splash screen images on iOS.
For Splash screen, it use 512*512 image for Andorid.
For IOS we need to add image for splash screen, no other way around currently.
![[PWA] Customize the Splash Screen of a PWA built with create-react-app](http://img.readke.com/220512/14202W360-0.jpg)
文章图片
First, we must tell iOS that the app is
apple-mobile-web-app-capable
with a
meta
tag.< meta name="apple-mobile-web-app-capable" content="yes">
Then we can specify each of those launch images as the image for that resolution.
< link rel="apple-touch-startup-image" href="https://www.songbingjia.com/android/splash_640x1136.jpg" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)"> < link rel="apple-touch-startup-image" href="https://www.songbingjia.com/android/splash_750x1334.jpg" media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)"> < link rel="apple-touch-startup-image" href="https://www.songbingjia.com/android/splash_1242x2208.jpg" media="(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)"> < link rel="apple-touch-startup-image" href="https://www.songbingjia.com/android/splash_1125x2436.jpg" media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)"> < link rel="apple-touch-startup-image" href="https://www.songbingjia.com/android/splash_1536x2048.jpg" 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="https://www.songbingjia.com/android/splash_1668x2224.jpg" 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="https://www.songbingjia.com/android/splash_2048x2732.jpg" media="(min-device-width: 1024px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait)">
Finally, in
manifest.json
, we have to actually remove the "background_color" setting first. Otherwise, that will override all of our images.【[PWA] Customize the Splash Screen of a PWA built with create-react-app】
推荐阅读
- iscroll在安卓高版本(6.0以上)某些机型上滑动卡顿问题的解决方法
- 高版本安卓手机的取证未来
- 机器与信任(如何减轻AI偏见)
- 从Oracle到SQL Server和从SQL Server到Oracle的迁移指南(2)
- 从Oracle到SQL Server和从SQL Server到Oracle的迁移指南(3)
- 未标记数据的半监督图像分类
- 星星重新排列(改善IMDb评分系统)
- 做功课(7个AWS认证解决方案架构师考试技巧)
- 时间戳截断(一个Ruby on Rails ActiveRecord的故事)