Joy
Joy

Reputation: 287

Cordova - How to not have a splash screen?

I don't want a splash screen for my Cordova project (Android and iOS), how to remove it? I tried to disable the splash screen plugin, but it continues to appear! How to solve?

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" id="app.appname" version="1.0.0">
    <name>App name</name>
    <description>
        App name description
    </description>
    <author email="[email protected]" href="http://cordova.io">
        Apache Cordova Team
    </author>
    <content src="index.html"/>
    <plugin name="cordova-plugin-whitelist" spec="1"/>
    <access origin="*"/>
    <allow-intent href="http://*/*"/>
    <allow-intent href="https://*/*"/>
    <allow-intent href="tel:*"/>
    <allow-intent href="sms:*"/>
    <allow-intent href="mailto:*"/>
    <allow-intent href="geo:*"/>
    <platform name="android">
        <allow-intent href="market:*"/>
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*"/>
        <allow-intent href="itms-apps:*"/>
    </platform>
    <preference name="SplashScreen" value="none"/>
</widget>

Upvotes: 4

Views: 5199

Answers (4)

Leif John
Leif John

Reputation: 818

Ah, finally! I struggled with the same problem. It seems - at least for the IOS build - that a a splash screen is mandatory no matter what I tried.

I found that I could add png files for each of the supported/recommended sizes, then the startup would use that one. I chose to have a proper picture, but you can create a blank (white or black) png if you do want.

Phonegap or IOS is picky on having all the various sizes available, so provide them all!

<platform name="ios">
    <icon platform="ios" src="www/res/icon/ios/icon.png"          height="57"  width="57" />
    <icon platform="ios" src="www/res/icon/ios/[email protected]"       height="114" width="114" />
    <icon platform="ios" src="www/res/icon/ios/icon-40.png"       height="40"  width="40" />
    <icon platform="ios" src="www/res/icon/ios/[email protected]"    height="80"  width="80" />
    <icon platform="ios" src="www/res/icon/ios/icon-50.png"       height="50"  width="50" />
    <icon platform="ios" src="www/res/icon/ios/[email protected]"    height="100" width="100" />
    <icon platform="ios" src="www/res/icon/ios/icon-60.png"       height="60"  width="60" />
    <icon platform="ios" src="www/res/icon/ios/[email protected]"    height="120" width="120" />
    <icon platform="ios" src="www/res/icon/ios/[email protected]"    height="180" width="180" />
    <icon platform="ios" src="www/res/icon/ios/icon-72.png"       height="72"  width="72" />
    <icon platform="ios" src="www/res/icon/ios/[email protected]"    height="144" width="144" />
    <icon platform="ios" src="www/res/icon/ios/icon-76.png"       height="76"  width="76" />
    <icon platform="ios" src="www/res/icon/ios/[email protected]"    height="152" width="152" />
    <icon platform="ios" src="www/res/icon/ios/icon-small.png"    height="29"  width="29" />
    <icon platform="ios" src="www/res/icon/ios/[email protected]" height="58"  width="58" />
    <icon platform="ios" src="www/res/icon/ios/[email protected]" height="87"  width="87" />
    <splash src="splash.png" width="320" height="480" />

    <!-- iPhone and iPod touch -->
    <splash src="www/res/splash/ios/default.png" platform="ios" width="320" height="480" />
    <splash src="www/res/splash/ios/[email protected]" platform="ios" width="640" height="960" />

    <!-- iPhone 5 / iPod Touch (5th Generation) -->
    <splash src="www/res/splash/ios/[email protected]" platform="ios" width="640" height="1136" />

    <!-- iPhone 6 -->
    <splash src="www/res/splash/ios/[email protected]" platform="ios" width="750" height="1334" />
    <splash src="www/res/splash/ios/[email protected]" platform="ios" width="1242" height="2208" />
    <!--<splash src="www/res/splash/ios/[email protected]" platform="ios" width="2208" height="1242" />-->

    <!-- iPad -->
    <splash src="www/res/splash/ios/default-portrait.png" platform="ios" width="768" height="1024" />
    <!--<splash src="www/res/splash/ios/default-landscape.png" platform="ios" width="1024" height="768" />-->

    <!-- Retina iPad -->
    <splash src="www/res/splash/ios/[email protected]" platform="ios" width="1536" height="2048" />
    <!--<splash src="www/res/splash/ios/[email protected]" platform="ios" width="2048" height="1536" />-->
</platform>

Upvotes: 1

pankaj shinde
pankaj shinde

Reputation: 54

Pls. do Change in config.xml as below:

<preference name="AutoHideSplashScreen" value="true" />
<preference name="SplashScreenDelay" value="0"/>

Upvotes: 2

Jose Rojas
Jose Rojas

Reputation: 3530

if the option:

<preference name="SplashScreen" value="none"/>

does not work.

You can do it putting this function onDeviceReady:

function onDeviceReady() { 
   navigator.splashscreen.hide();
}

in your config.xml must be splashscreen plugin

<gap:plugin name="org.apache.cordova.splashscreen" />

if this option does not work you can put splashscreen image by default in blank and put into your config.xml

<gap:splash src="splash.png" /

putting the splash.png image at the root of your project.

Upvotes: 1

404
404

Reputation: 1165

As you are using cordova for your project, you can easily remove the splash screen by adding this tag to the config.xml

<preference name="SplashScreen" value="none"/>

Upvotes: 2

Related Questions