Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove Title Bar Phonegap

How to remove the title bar that is showing for a second or so at the start of the application in phonegap build? I tried fullscreen as showed in Phonegap remove title bar at start and its working, the app is full screen but the title bar stil shows up for a second or so at the start of the app. When buildin locally I can remove the title bar form manifest.xml with the command android:theme="@android:style/Theme.NoTitleBar">

How can I completely remove the title bar from phonegap build?

I solved it by adding these lines to the 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>
like image 465
Alex Stanese Avatar asked Feb 19 '14 14:02

Alex Stanese


1 Answers

Alex already provided the solution in the first post. I'd just like to clarify two things:

  1. You don't have to disable support for certain screen sizes for this to work. Note that I've changed the attributes of supports-screens back to true
  2. You need to also provide an android namespace, or PhoneGap Build will complain about a "malformed config.xml" (see the line in bold below)

So this would be your config.xml:

<widget xmlns = "http://www.w3.org/ns/widgets" 
    xmlns:gap = "http://phonegap.com/ns/1.0"

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>

Hat tip to wildabeast on github.

like image 64
robro Avatar answered Nov 15 '22 11:11

robro