在PhoneGap config.xml中放置gap:config-file的位置

时间:2015-07-03 12:33:26

标签: cordova phonegap-build

我想隐藏应用程序启动时快速显示的PhoneGap应用程序的标题栏。我找到了一个解决方案(Remove Title Bar Phonegap)但是当我尝试应用它时,PhoneGap Build告诉我我的config.xml有错误。

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.phonegap.helloworld" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
    <name>Hello World</name>
    <description>
        Hello World sample application that responds to the deviceready event.
    </description>
    <author email="support@phonegap.com" href="http://phonegap.com">
        PhoneGap Team
    </author>
    <content src="index.html" />
    <preference name="permissions" value="none" />
    <preference name="phonegap-version" value="3.7.0" />
    <preference name="orientation" value="default" />
    <preference name="target-device" value="universal" />
    <preference name="fullscreen" value="true" />
    <preference name="android-minSdkVersion" value="7" />

    <gap:plugin name="org.apache.cordova.splashscreen" />
    <preference name="SplashScreen" value="screen"/>
    <preference name="SplashScreenDelay" value="10000" />

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

    <gap:config-file platform="android" parent="/manifest">
        <supports-screens 
            android:xlargeScreens="true" 
            android:largeScreens="true" 
            android:smallScreens="true" />
        <application android:theme="@android:style/Theme.NoTitleBar" >
            <activity android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
            </activity>
        </application>
    </gap:config-file>
</widget>

这是它应该隐藏标题栏的<gap:config-file的最后一部分。 谁能说出我做错了什么?我是PhoneGab的新手,并做了很多副本。粘贴,但。但我当然试着理解事情。

1 个答案:

答案 0 :(得分:2)

我怀疑你得到了一个&#34;未定义的错误&#34;。我发现你在第一个XML元素<widget>

中缺少Android部分

你应该添加:

xmlns:android = "http://schemas.android.com/apk/res/android"