我在config.xml文件中添加了flashscreen,如下所示:
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="5000" />
<preference name="ShowSplashScreenSpinner" value="false"/>
<preference name="SplashShowOnlyFirstTime" value="false" />
<plugin name="cordova-plugin-splashscreen" source="npm" />
<platform name="android">
<icon density="ldpi" src="res/icon/android/drawable-ldpi-icon.png" />
<icon density="mdpi" src="res/icon/android/drawable-mdpi-icon.png" />
<icon density="hdpi" src="res/icon/android/drawable-hdpi-icon.png" />
<icon density="xhdpi" src="res/icon/android/drawable-xhdpi-icon.png" />
<icon density="xxhdpi" src="res/icon/android/drawable-xxhdpi-icon.png" />
<icon density="xxxhdpi" src="res/icon/android/drawable-xxxhdpi-icon.png" />
<splash density="land-ldpi" src="res/screen/android/drawable-land-ldpi-screen.png" />
<splash density="land-mdpi" src="res/screen/android/drawable-land-mdpi-screen.png" />
<splash density="land-hdpi" src="res/screen/android/drawable-land-hdpi-screen.png" />
<splash density="port-ldpi" src="res/screen/android/drawable-port-ldpi-screen.png" />
<splash density="port-mdpi" src="res/screen/android/drawable-port-mdpi-screen.png" />
<splash density="port-hdpi" src="res/screen/android/drawable-port-hdpi-screen.png" />
</platform>
<platform name="ios">
<icon src="res/icon/ios/icon-60@3x.png" width="180" height="180" />
<icon src="res/icon/ios/icon-60.png" width="60" height="60" />
<icon src="res/icon/ios/icon-60@2x.png" width="120" height="120" />
<icon src="res/icon/ios/icon-76.png" width="76" height="76" />
<icon src="res/icon/ios/icon-76@2x.png" width="152" height="152" />
<icon src="res/icon/ios/icon-40.png" width="40" height="40" />
<icon src="res/icon/ios/icon-50@2x.png" width="100" height="100" />
<icon src="res/icon/ios/icon-83.5@2x.png" width="167" height="167" />
<splash src="res/screen/ios/Default~iphone.png" width="320" height="480"/>
<splash src="res/screen/ios/Default@2x~iphone.png" width="640" height="960"/>
<splash src="res/screen/ios/Default-Portrait~ipad.png" width="768" height="1024"/>
<splash src="res/screen/ios/Default-Portrait@2x~ipad.png" width="1536" height="2048"/>
<splash src="res/screen/ios/Default-736h.png" width="1242" height="2208"/>
<splash src="res/screen/ios/Default-Landscape-736h.png" width="2208" height="1242"/>
</platform>
我所有的启动画面都在这里:res/screen/android/
。我与本地和phonegap构建绑定,但在android中的启动画面只显示。 iphone启动画面工作正常。