删除标题栏Phonegap

Ale*_*ese 5 phonegap-plugins cordova phonegap-build cordova-3

如何删除在phonegap构建中应用程序开始时显示一秒左右的标题栏?我尝试全屏,如Phonegap中所示,在开始时移除标题栏及其工作,应用程序是全屏但标题栏stil在应用程序开始时显示一秒左右.在本地构建时,我可以使用命令android:theme ="@ android:style/Theme.NoTitleBar">删除标题栏表单manifest.xml

如何从phonegap构建中完全删除标题栏?

我通过将这些行添加到config.xml来解决它

<gap:config-file platform="android" parent="/manifest">

       <supports-screens 
              android:xlargeScreens="false" 
              android:largeScreens="false" 
              android:smallScreens="false" />
        <application android:theme="@android:style/Theme.NoTitleBar" >
            <activity android:theme="@android:style/Theme.NoTitleBar.Fullscreen" ></activity>
        </application>
</gap:config-file>
Run Code Online (Sandbox Code Playgroud)

rob*_*bro 9

Alex已在第一篇文章中提供了解决方案.我想澄清两件事:

  1. 您无需禁用对某些屏幕尺寸的支持即可使用.请注意,我已将更改的属性更改supports-screenstrue
  2. 你还需要提供一个android命名空间,或者PhoneGap Build会抱怨"格式错误的config.xml"(参见下面的粗体行)

所以这将是你的config.xml:

<widget xmlns = "http://www.w3.org/ns/widgets" 
    xmlns:gap = "http://phonegap.com/ns/1.0"
Run Code Online (Sandbox Code Playgroud)

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

    id        = "com.domain.app"
    version   = "1.0.0">

    ...

    <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>
Run Code Online (Sandbox Code Playgroud)

帽子提示github上的wildabeast .

  • 这条线上最好的答案!解决phonegap构建标题问题 (2认同)

小智 -1

尝试添加闪屏(如果您还没有)我尝试过,您再也看不到标题栏了。

对于 Android,您的 config.xml 需要这些:

<icon src="icons/android/ldpi.png" gap:platform="android" gap:density="ldpi" />
<icon src="icons/android/mdpi.png" gap:platform="android" gap:density="mdpi" />
<icon src="icons/android/hdpi.png" gap:platform="android" gap:density="hdpi" />
<icon src="icons/android/xhdpi.png" gap:platform="android" gap:density="xhdpi" />
Run Code Online (Sandbox Code Playgroud)

然后将您的图像添加到 src 中。