简体   繁体   English

Cordova 启动画面不显示

[英]Cordova splash screen not displaying

So I have got a simple splash screen that needs to be displayed for my android app.所以我有一个简单的启动画面,需要为我的 android 应用程序显示。 All I see is a white screen instead of the splash screen image.我看到的只是一个白屏,而不是闪屏图像。 I am not sure why its behaving like this as the settings are fairly straight forward in config.xml.我不知道为什么它的行为是这样的,因为 config.xml 中的设置相当简单。

Can someone point out if I am doing anything wrong?有人可以指出我是否做错了什么吗?

I have all the required image files placed in the correct folders.我已将所有必需的图像文件放在正确的文件夹中。 So I am not sure what else needs to be checked.所以我不确定还需要检查什么。

 <?xml version='1.0' encoding='utf-8'?>
<widget id="com.tmwsystems.ies.inmotion.driver" version="1.0.9" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
    <name>IES InMotion Driver</name>
    <description>IES InMotion Driver</description>
    <author email="support@iesaccess.com" href="http://tmwsystems.com/innovative">Trimble IES InMotion Team</author>
    <content src="index.html" />
    <!-- PAVT 001 - Added below lines -->
    <prefernce name="phonegap-version" value="cli-6.5.0" />
    <preference name="android-minSdkVersion" value="23" />
    <preference name="android-targetSdkVersion" value="28" /> <!-- * PAVT 002 - Changed target version to 28 from 26 -->
    <feature name="IntentAndNavigationFilter">
        <param name="ios-package" value="CDVIntentAndNavigationFilter" />
        <param name="onload" value="true" />
    </feature>
    <!-- *  PAVT 001 -->
    <preference name="permissions" value="none" />
    <preference name="orientation" value="portrait" />
    <!-- PAVT 003 - Added below lines -->
    <preference name="target-device" value="universal" />
    <preference name="fullscreen" value="true" />
    <preference name="webviewbounce" value="true" />
    <preference name="prerendered-icon" value="true" />
    <preference name="stay-in-webview" value="false" />
    <preference name="ios-statusbarstyle" value="black-opaque" />
    <preference name="detect-data-types" value="true" />
    <preference name="exit-on-suspend" value="false" />
    <preference name="show-splash-screen-spinner" value="true" />
    <preference name="auto-hide-splash-screen" value="true" />
    <preference name="disable-cursor" value="false" />
    <preference name="android-minSdkVersion" value="23" />
    <preference name="android-installLocation" value="auto" />
    <plugin name="cordova-plugin-splashscreen" source="npm" />
    <preference name="SplashScreenDelay" value="5" />
    <preference name="AutoHideSplashScreen" value="true" />
    <preference name="SplashScreen" value="splash" />
    <preference name="SplashMaintainAspectRatio" value="true" />
    <gap:plugin name="org.apache.cordova.battery-status" />
    <gap:plugin name="org.apache.cordova.camera" />
    <gap:plugin name="org.apache.cordova.media-capture" />
    <gap:plugin name="org.apache.cordova.console" />
    <gap:plugin name="org.apache.cordova.contacts" />
    <gap:plugin name="org.apache.cordova.device" />
    <gap:plugin name="org.apache.cordova.device-motion" />
    <gap:plugin name="org.apache.cordova.device-orientation" />
    <gap:plugin name="org.apache.cordova.dialogs" />
    <gap:plugin name="org.apache.cordova.file" spec="~4.0.0" />
    <gap:plugin name="org.apache.cordova.file-transfer" />
    <gap:plugin name="org.apache.cordova.geolocation" />
    <gap:plugin name="org.apache.cordova.globalization" />
    <gap:plugin name="org.apache.cordova.inappbrowser" />
    <gap:plugin name="org.apache.cordova.media" />
    <gap:plugin name="org.apache.cordova.network-information" />
    <gap:plugin name="org.apache.cordova.vibration" />
    <icon src="icon.png" />
    <icon gap:platform="ios" height="60" src="res/icons/ios/icon-60.png" width="60" />
    <icon gap:platform="ios" height="120" src="res/icons/ios/icon-60-2x.png" width="120" />
    <icon gap:platform="ios" height="180" src="res/icons/ios/icon-60-3x.png" width="180" />
    <icon gap:platform="ios" height="76" src="res/icons/ios/icon-76.png" width="76" />
    <icon gap:platform="ios" height="152" src="res/icons/ios/icon-76-2x.png" width="152" />
    <icon gap:platform="ios" height="40" src="res/icons/ios/icon-40.png" width="40" />
    <icon gap:platform="ios" height="80" src="res/icons/ios/icon-40-2x.png" width="80" />
    <icon gap:platform="ios" height="57" src="res/icons/ios/icon-57.png" width="57" />
    <icon gap:platform="ios" height="114" src="res/icons/ios/icon-57-2x.png" width="114" />
    <icon gap:platform="ios" height="72" src="res/icons/ios/icon-72.png" width="72" />
    <icon gap:platform="ios" height="144" src="res/icons/ios/icon-72-2x.png" width="144" />
    <icon gap:platform="ios" height="29" src="res/icons/ios/icon-small.png" width="29" />
    <icon gap:platform="ios" height="58" src="res/icons/ios/icon-small-2x.png" width="58" />
    <icon gap:platform="ios" height="50" src="res/icons/ios/icon-50.png" width="50" />
    <icon gap:platform="ios" height="100" src="res/icons/ios/icon-50-2x.png" width="100" />
    <icon gap:platform="android" gap:qualifier="ldpi" src="res/icons/android/icon-36-ldpi.png" />
    <icon gap:platform="android" gap:qualifier="mdpi" src="res/icons/android/icon-48-mdpi.png" />
    <icon gap:platform="android" gap:qualifier="hdpi" src="res/icons/android/icon-72-hdpi.png" />
    <icon gap:platform="android" gap:qualifier="xhdpi" src="res/icons/android/icon-96-xhdpi.png" />
    <icon gap:platform="android" gap:qualifier="xxhdpi" src="res/icons/android/icon-144-xxhdpi.png" />
    <icon gap:platform="android" gap:qualifier="xxxhdpi" src="res/icons/android/icon-192-xxxhdpi.png" />
    <!-- splash src="splash.png" -->
    <splash gap:platform="ios" height="480" src="res/screens/ios/screen-iphone-portrait.png" width="320" />
    <splash gap:platform="ios" height="960" src="res/screens/ios/screen-iphone-portrait-2x.png" width="640" />
    <splash gap:platform="ios" height="1024" src="res/screens/ios/screen-ipad-portrait.png" width="768" />
    <splash gap:platform="ios" height="2048" src="res/screens/ios/screen-ipad-portrait-2x.png" width="1536" />
    <splash gap:platform="ios" height="768" src="res/screens/ios/screen-ipad-landscape.png" width="1024" />
    <splash gap:platform="ios" height="1536" src="res/screens/ios/screen-ipad-landscape-2x.png" width="2048" />
    <splash gap:platform="ios" height="1136" src="res/screens/ios/screen-iphone-568h-2x.png" width="640" />
    <!--splash gap:platform="ios" height="1334" src="res/screens/ios/screen-iphone-portrait-667h.png" width="750" />
    <splash gap:platform="ios" height="2208" src="res/screens/ios/screen-iphone-portrait-736h.png" width="1242" />
    <splash gap:platform="ios" height="1242" src="res/screens/ios/screen-iphone-landscape-736h.png" width="2208" / -->
    **<splash gap:platform="android" gap:qualifier="land-hdpi" src="res/screens/android/screen-hdpi-landscape.png" />
    <splash gap:platform="android" gap:qualifier="land-ldpi" src="res/screens/android/screen-ldpi-landscape.png" />
    <splash gap:platform="android" gap:qualifier="land-mdpi" src="res/screens/android/screen-mdpi-landscape.png" />
    <splash gap:platform="android" gap:qualifier="land-xhdpi" src="res/screens/android/screen-xhdpi-landscape.png" />
    <splash gap:platform="android" gap:qualifier="port-hdpi" src="res/screens/android/screen-hdpi-portrait.png" />
    <splash gap:platform="android" gap:qualifier="port-ldpi" src="res/screens/android/screen-ldpi-portrait.png" />
    <splash gap:platform="android" gap:qualifier="port-mdpi" src="res/screens/android/screen-mdpi-portrait.png" />
    <splash gap:platform="android" gap:qualifier="port-xhdpi" src="res/screens/android/screen-xhdpi-portrait.png" />**
    <!-- PAVT 003 -->
    <access origin="*" />
    <!-- PAVT 004 - Added below lines -->
    <allow-navigation href="http://*/*" />
    <allow-navigation href="https://*/*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <!--  PAVT 004 !-->
    <!-- PAVT 005 Added below lines !-->
    <platform name="android">
        <allow-intent href="market:*" />
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
    </platform>     
    <!-- PAVT 005 Added below lines -->
    
    <plugin name="cordova-plugin-whitelist" spec="~1.2.2" /> <!--  PAVT 006 - Changed spec to 1.2.2 from 1 !-->
    
    
<!-- PAVT 005 Commenting out below lines  
<platform name="android">
  

    you can use any density that exists in the Android project 
 
    <splash src="res/screen/android/screen-hdpi-portrait.png" density="port-hdpi" />
    <splash src="res/screen/android/screen-ldpi-portrait.png" density="port-ldpi" />
    <splash src="res/screen/android/screen-mdpi-portrait.png" density="port-mdpi" />
    <splash src="res/screen/android/screen-xhdpi-portrait.png" density="port-xhdpi" />
 
</platform>
  PAVT 005   -->
    
    

    <preference name="AndroidPersistentFileLocation" value="Compatibility" />
    <plugin name="cordova-plugin-camera" spec="^4.1.0" />
    <plugin name="cordova-plugin-console" spec="^1.1.0" />
    <plugin name="cordova-plugin-device" spec="^2.0.3" />
    <plugin name="cordova-plugin-splashscreen" spec="^5.0.3" />
    <plugin name="cordova-plugin-screen-orientation" spec="^3.0.2" />
    <plugin name="cordova-plugin-spinner-dialog" spec="^1.3.1" />
    <plugin name="cordova-plugin-dialogs" spec="^2.0.2" />
    <plugin name="com.kofax.cordova" spec="C:\Users\jbarajas\Documents\KOFAX\SDK3.5.0.3\KofaxMobileSDK-3.5.0.3\Hybrid\PhoneGap\Plugins\com.kofax.mobile.plugins.sdk" />
    
</widget>

SplashScreenDelay preference value is too low in your config.xml. config.xml 中的 SplashScreenDelay 首选项值太低。 Try this尝试这个

<preference name="SplashScreen" value="screen"/>
<preference name="SplashScreenDelay" value="3000"/>
<splash src="splash.png"/>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM