user780756
user780756

Reputation: 1484

Cordova fullscreen splash screen on Android still shows title bar

I am creating a fullscreen app using latest cordova. I have added the splash screen images and the plugin for it. And also in the config.xml, the preference to launch the app in fullscreen

<preference name="Fullscreen" value="true" />
<preference name="Orientation" value="landscape" />    
<preference name="SplashScreenDelay" value="1000" />

When running the app, the splash screen shows up, but the problem is that the app still shows the title bar on top, until the app finishes showing the splash screen, where the app finally goes into true full screen.

Is there a way/flag/mod to make the fullscreen work correctly while splash screen is displayed?

Upvotes: 3

Views: 5830

Answers (2)

raphinesse
raphinesse

Reputation: 20968

Del's answer definitely solves the problem, but it is problematic if you have the platforms directory ignored (it is derived content after all).

Fortunately, starting with [email protected] you can use <edit-config> in config.xml too:

<?xml version='1.0' encoding='utf-8'?>
<widget ... xmlns:android="http://schemas.android.com/apk/res/android">
    ...
    <edit-config file="AndroidManifest.xml" mode="merge"
                 target="/manifest/application/activity">
        <activity android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
    </edit-config>
    ...
</widget>

This will ensure that AndroidManifest.xml will get updated whenever it is generated. Mind the additional XML Namespace for Android.

Upvotes: 13

V&#237;ctor
V&#237;ctor

Reputation: 3039

The best way to show a full screen splash is by putting this line in your manifest under activity tag

android:theme="@android:style/Theme.Light.NoTitleBar.Fullscreen"

Upvotes: 6

Related Questions