2015-07-03 126 views
0

我想在應用程序啓動時快速顯示的PhoneGap App上隱藏標題欄。我找到了一個解決方案(Remove Title Bar Phonegap),但是當我嘗試應用它時,PhoneGap Build告訴我我的config.xml有錯誤。把PhoneGap的配置文件放在哪裏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="[email protected]" 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的新手,並且還做了很多副本&粘貼。但我當然試着理解事情。

+0

做你試試這個:'<活動的android:主題=「@安卓風格/ Theme.NoTitleBar。 Fullscreen「>''你是否也嘗試寫'Fullscreen'而不是'fullscreen'? – Sithys

+0

我試過全屏,但沒有幫助。 ,這不正是我在我的代碼中所擁有的嗎? – almo

+0

sry,沒有看到。這是一樣的 – Sithys

回答

2

我懷疑你正在得到一個「未定義的錯誤」。我看你是缺少Android部分在第一XML元素<widget>

您應該添加:

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