科尔多瓦3.4闪屏不能正常工作 [英] Cordova 3.4 Splashscreen not working

查看:111
本文介绍了科尔多瓦3.4闪屏不能正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Android的PhoneGap proyect,我试图利用闪屏插件科尔多瓦提供。我想我拥有了一切正确设置...以下是我认为code的作品是相关的。

I have an Android Phonegap proyect and I'm trying to use the Splashscreen plugin Cordova provides. I think I have everything correctly set... Here are the pieces of code I think are relevant.

的Config.xml

<widget ...>
    ...
    <preference name="SplashScreen" value="screen" />
    <preference name="SplashScreenDelay" value="15000" />
    <plugin name="SplashScreen" value="org.apache.cordova.SplashScreen"/>
</widget>

的index.html

<script type="text/javascript" charset="utf-8">
    function onLoad() {
        document.addEventListener("deviceready", onDeviceReady, false);
    }

    function onDeviceReady() {
        navigator.splashscreen.hide()
    }
</script>

我已经正确地使用CLI安装该插件和飞溅本身在Android项目的RES /绘*文件夹,因为我觉得这是应该的,但不管是什么我尽量去做,飞溅没有显示。甚至不是一个默认值。不是即使我禁用navigator.splashscreen.hide()函数(如果它是太快)。

I have correctly installed with the CLI the plugin and the splash itself is in the res/drawable* folders in the Android project as I think it should be, but regardless of what I try to do, the splash is not showing. Not even a default one. Not even if I disable the navigator.splashscreen.hide() function (in case it was too fast).

我绝对现在失去了,一直在努力了一个星期的调整,但我就是不能看到它。

I'm absolutely lost now, have been trying tweaks for a week but I just can't see it.

推荐答案

我用科尔多瓦v3.6.3在我的Andr​​oid项目。

I'm using cordova v3.6.3 in my android project.

我读了API&安培;插件之证件,但是,我迷糊中配置的一些选项。
但是,我发现了一个完美的解决方案。

I read a API & Plugin Documentations but, I confused the some options in config. but, I found a perfect solution.

1。首先,你并不需要使用
    navigator.splashscreen.hide()或.show()的Andr​​oid项目。

2。请参阅理解清楚我的目录结构。

3。添加以下codeS到config.xml文件中。
     ※不要更改值=屏幕。
        你只需要改变你的形象闪屏src和延迟值。

3. Add following codes into your config.xml file. ※ Do not change the value="screen". you just change the src and delay value for your splashscreen image.

[Config.xml中]

<platform name="android">
    <splash src="www/res/screen/android/screen-default.png" />
</platform>
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="4000" />

4。删除理解清楚地绘制目录下的screen.png文件。

5。在命令行上构建项目(科尔多瓦构建Android)
 并且,再看看绘制目录。

我会答应,你会成功的。 : - )

I'll promise, you'll success. :-)

这篇关于科尔多瓦3.4闪屏不能正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆