问题描述
如何移除在phonegap构建应用程序开始时显示一秒左右的标题栏?
我尝试了全屏,如所示和它的工作,应用程序是全屏幕,但标题栏stil显示了一秒左右在应用程序的开始。
当本地buildin时,我可以使用命令android:theme =@ android:style / Theme.NoTitleBar>
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">
如何从phonegap build中完全删除标题栏?
How can I completely remove the title bar from phonegap build?
我通过将这些行添加到config.xml中解决了
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>
推荐答案
Alex已经在第一篇文章中提供了解决方案。我只想澄清两件事:
Alex already provided the solution in the first post. I'd just like to clarify two things:
- 您不必为某些屏幕尺寸禁用此功能。请注意,我已将
supports-screens
的属性更改回true
- 你还需要提供一个android命名空间,或PhoneGap Build会抱怨一个malformed config.xml(见下面的粗体行)。
- 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 totrue
- You need to also provide an android namespace, or PhoneGap Build will complain about a "malformed config.xml" (see the line in bold below)
所以这将是你的config.xml:
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
/ p>
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>
提示至wildabeast 。
Hat tip to wildabeast on github.
这篇关于删除标题栏Phonegap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!