cordova – 如何没有启animation面?

我不想为我的Cordova项目(Android和iOS)启动一个启animation面,如何删除它? 我试图禁用启animation面插件,但它继续出现! 怎么解决?

<?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="dev@cordova.apache.org" 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> 

PLS。 在config.xml中更改如下:

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

正如你正在为你的项目使用cordova,你可以通过将这个标签添加到config.xml来轻松删除启animation面

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

如果选项:

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

不起作用。

你可以把这个函数放在OnDeviceReady上:

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

在你的config.xml中必须是splashscreen插件

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

如果这个选项不起作用,你可以把splashscreen图像默认放在空白处并放到你的config.xml中

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

将splash.png图像放在项目的根目录下。

啊,终于! 我也遇到了同样的问题。 看起来 – 至less在IOS版本中 – 无论我尝试了什么,启animation面都是强制性的。

我发现我可以为每个支持/推荐的大小添加png文件,然后启动将使用该文件。 我select了一个合适的图片,但是如果你想要的话,你可以创build一个空白的(白色或黑色)PNG。

Phonegap或IOS挑剔有各种各样的大小可用,所以提供他们所有!

 <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/icon@2x.png" 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/icon-40@2x.png" 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/icon-50@2x.png" 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/icon-60@2x.png" height="120" width="120" /> <icon platform="ios" src="www/res/icon/ios/icon-60@3x.png" 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/icon-72@2x.png" 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/icon-76@2x.png" 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/icon-small@2x.png" height="58" width="58" /> <icon platform="ios" src="www/res/icon/ios/icon-small@3x.png" 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/default@2x.png" platform="ios" width="640" height="960" /> <!-- iPhone 5 / iPod Touch (5th Generation) --> <splash src="www/res/splash/ios/default-568h@2x.png" platform="ios" width="640" height="1136" /> <!-- iPhone 6 --> <splash src="www/res/splash/ios/default-667h@2x.png" platform="ios" width="750" height="1334" /> <splash src="www/res/splash/ios/default-portrait-736h@3x.png" platform="ios" width="1242" height="2208" /> <!--<splash src="www/res/splash/ios/default-landscape-736h@3x.png" 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/default-portrait@2x.png" platform="ios" width="1536" height="2048" /> <!--<splash src="www/res/splash/ios/default-landscape@2x.png" platform="ios" width="2048" height="1536" />--> </platform>