简体   繁体   中英

Removing splash-screen loading gif from Cordova app

I'm having a problem overriding Cordova's defaults when writing an app.

I'm writing an iOS app using the Cordova (formerly PhoneGap) framework and Xcode. Cordova lets me add a splash screen for the project by just dragging and dropping it in under the info tab for my project in Xcode. This part works fine, but there is a default loading-indicator gif running over the top of the splash image (I'm not sure whether it's from Xcode or from Cordova).

How can I remove the loading-indicator image?

You can remove the loading spinner in Cordova.plist. Set ShowSplashScreenSpinner to false.

Update : In Cordova 3.0+ adding <preference name="ShowSplashScreenSpinner" value="false" /> to your config.xml will accomplish the same goal.

I just removed the Launch images source and set the launch screen file to mainviewcontroller

Go to General Setting -> at bottom side Launch images resource and launch screen setting is available

If you have an IOS device i have a working method that you can use, it solved my problem when compiling for IOS. (Firstly i want to say you need to add an icon and splash in the correct folders or else Cordova will their default ones for you and also make sure that they are large enough so that the resources can be generated accordingly):

  1. Remove the SplashScreen plugin provided using
        cordova plugin rm cordova-plugin-splashscreen
  1. Place your icon in the resources/ios/ folder and name it

icon.png

  1. Go to the route of your directory and add your splash image (make sure that splash.png is 2800px * 2800px)

splash.png 在此输入图像描述

  1. Remove the ios platform if you installed it already and then re add it
        ionic cordova platform rm ios
        ionic cordova platform add ios

5.Run the following command to generate your icon

        ionic cordova resources ios --icon

if building for android

        ionic cordova resources android --icon

6.Add the following lines to your config.xml

    <preference name="SplashScreen" value="none" />
    <preference name="SplashScreenDelay" value="0" />
    <preference name="AutoHideSplashScreen" value="true" />
    <preference name="FadeSplashScreen" value="false" />
    <preference name="ShowSplashScreenSpinner" value="false" />

This should solve the default icon and remove the splash screen which Cordova adds to the IOS project by default. I hope it helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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