问题
I want to hide the title bar on a PhoneGap App that shows quickly when the app starts. I found a solution (Remove Title Bar Phonegap) but when I try to apply it PhoneGap Build tells me that my config.xml has errors.
<?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>
It's the last part where its says <gap:config-file
which should hide the title bar.
Can anyone tell what I am doing wrong? I am new to PhoneGab and doing a lot a copy & paste, yet. But of course I try to understand things.
回答1:
I suspect your are getting an "undefined error". I see you are missing the Android part in the first XML element <widget>
You should add:
xmlns:android = "http://schemas.android.com/apk/res/android"
来源:https://stackoverflow.com/questions/31206998/where-to-put-gapconfig-file-in-phonegap-config-xml