科尔多瓦 - 如何没有闪屏?

时间:2016-01-12 15:36:23

标签: android ios cordova

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

<?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>

3 个答案:

答案 0 :(得分:2)

当您在项目中使用cordova时,可以通过将此标记添加到config.xml来轻松删除启动画面

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

答案 1 :(得分:1)

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

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

答案 2 :(得分:0)

如果选项:

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

不起作用。

你可以把这个功能放在DeviceReady上:

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图像放在项目的根目录中。

相关问题