1

我将 splash.png 添加到默认根目录(带有 index.html 路径)然后我将 splash 插件添加到 config.xml

<preference name="phonegap-version" value="cli-6.3.0" />
<preference name="SplashScreenDelay" value="5000" />
<plugin name="cordova-plugin-splashscreen" source="npm" />
<splash src="splash.png" />

这有什么问题?为什么它不显示我的 splash.png?它显示 phonegap 默认启动图标

4

1 回答 1

1

众所周知,启动画面很难正确处理。仅使用一个“splash.png”图像时,我总是遇到问题,因此我建议为您当前的设备调整一个启动屏幕的大小,然后添加其他的。利用以下尺寸,确保文件夹结构和图像尺寸完全匹配。否则,将显示默认的 PhoneGap。

注意:文件夹路径不必如下:“splash/ios”。与“Default-568h@2x~iphone.png”等文件名相同 - 只要实际文件名匹配,您可以随意命名它们!

<!-- iPhone 5 / iPod Touch (5th Generation) -->
<splash src="splash/ios/Default-568h@2x~iphone.png" platform="ios" width="640" height="1136" />

<!-- iPhone 6 -->
<splash src="splash/ios/Default-667h.png" platform="ios" width="750" height="1334" />
<splash src="splash/ios/Default-736h.png" platform="ios" width="1242" height="2208" />
<splash src="splash/ios/Default-Landscape-736h.png" platform="ios" width="2208" height="1242" />

<!-- iPad -->
<splash src="splash/ios/Default-Portrait~ipad.png" platform="ios" width="768" height="1024" />
<splash src="splash/ios/Default-Landscape~ipad.png" platform="ios" width="1024" height="768" />

<!-- Retina iPad -->
<splash src="splash/ios/Default-Portrait@2x~ipad.png" platform="ios" width="1536" height="2048" />
<splash src="splash/ios/Default-Landscape@2x~ipad.png" platform="ios" width="2048" height="1536" />
于 2017-05-01T17:38:00.343 回答