【问题标题】:Eclipse android phonegap config.xml not working?Eclipse android phonegap config.xml 不起作用?
【发布时间】:2011-11-22 23:09:27
【问题描述】:

我终其一生都无法弄清楚为什么我的 XML 文件无法正常工作。它位于我的资产 www 文件夹中:图像的链接是正确的 - 我的应用程序的 id 是相同的,但它仍然不会显示我的启动屏幕或图标!

救命!

<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns = "http://www.w3.org/ns/widgets"
    xmlns:gap = "http://phonegap.com/ns/1.0"
    id = "com.phonegap.helloword"
    version = "1.0.0">

    <name>Testerm Application</name>

    <description>
    A test application for PhoneGap
    </description>

    <author href="graemeleighfield@infinitegroup.co.uk" email="graemeleighfield@infinitegroup.co.uk">
    Graeme Leighfield
    </author>

    <icon src="img/icon.png" width="72" height="72" ></icon>

    <gap:spalsh src="img/ash.jpg"/>

    <feature name="http://api.phonegap.com/1.0/geolocation"/>
    <feature name="http://api.phonegap.com/1.0/network"/>
</widget>

【问题讨论】:

  • 我注意到 gap:spalsh 拼写错误?你解决过这个问题吗?

标签: android xml web-applications cordova


【解决方案1】:

是的,config.xml 仅适用于 build.phonegap.com。

使用 Eclipse 构建:

在 res/drawable-hdpi 文件夹中创建一个带有 splash.png 文件名的斜线屏幕。 将 super.setIntegerProperty("splashscreen", R.drawable.splash) 添加到您的 App.java 文件中。

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    super.setIntegerProperty("splashscreen", R.drawable.splash);
    super.loadUrl("file:///android_asset/www/index.html");
}

【讨论】:

  • 我觉得你的回答更好。
  • 这目前有效,但会引发以下调试消息 - Setting integer properties in DroidGap will be deprecated in 3.1 on August 2013, please use config.xml
【解决方案2】:

Graeme,你是在 Eclipse 中构建本地化吗?

如果是,那么 config.xml 和 should't' 根本工作 - 它仅适用于 http://build.phonegap.com - 不适用于您的本地开发。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-16
    • 1970-01-01
    • 2013-08-31
    相关资源
    最近更新 更多