Search code examples
splash-screenphonegap-buildnine-patch

Phongap build useing splash.9.png as default splashscreen for android


Phone gap build documentation states that:

The default splash must be named splash.png and must reside in the root of your application folder.

<gap:splash src="splash.png" />

but they also say:

Patch-9 backgrounds are supported. All patch-9 files have to have a ".9.png" suffix.

Does this mean that I can use

<gap:splash src="splash.9.png" />

as the default ?


Solution

  • You are right, according to the documentation, you can't use a 9-patch image as default splash.
    Extracts from the Phonegap Build Documentation page:

    The default splash must be named splash.png and must reside in the root of your application folder.

    and

    All patch-9 files have to have a ".9.png" suffix.

    I suggest the following solution: Use the same splash.9.png source for all Android sizes and you will have a similar result. One file for all screens.

    <gap:splash src="splash.9.png" gap:platform="android" gap:qualifier="ldpi" />
    <gap:splash src="splash.9.png" gap:platform="android" gap:qualifier="mdpi" />
    <gap:splash src="splash.9.png" gap:platform="android" gap:qualifier="hdpi" />
    <gap:splash src="splash.9.png" gap:platform="android" gap:qualifier="xhdpi" />
    <gap:splash src="splash.9.png" gap:platform="android" gap:qualifier="xxhdpi" />
    <gap:splash src="splash.9.png" gap:platform="android" gap:qualifier="xxxhdpi" />
    

    Still, the default splash.png must be present, but will not be used on Android.

    <gap:splash src="splash.png" />