BB10: How to add a splash screen

The following instructions use PNG images, but JPG images work as well.

Right click bar-descriptor.xml and select Open With, then Text Editor.

Look for:

    <!--  The splash screen that will appear when your application is launching. Should be 1024x600. -->
    <!-- <splashscreen></splashscreen> -->

Note that this comment still refers to the 1024x600 resolution of the PlayBook, but we'll want to use a resolution of 1280x768.

Splash Screen for Landscape-only App

If your app is only intended to be used in landscape mode, then replace the commented out splash screen markup in bar-descriptor.xml with:

    <asset path="splashscreen.png">splashscreen.png</asset>
    <splashscreen>splashscreen.png</splashscreen>

Obviously be sure to drag and drop your splash screen image into the root directory of your project.

Also, in the <initialWindow> section of bar-descriptor.xml, add:

    <aspectRatio>landscape</aspectRatio>
    <autoOrients>false</autoOrients>

Splash Screen for Portrait-only App

The <splashscreen> tag allows you to specify both the landscape and portrait splash screens. To do that, you separate the file names with a colon. (:)

Since we only want the portrait splash screen, we want:

    <asset path="splashscreen.png">splashscreen.png</asset>
    <splashscreen>:splashscreen.png</splashscreen>

(Note the colon prior to the file name)

Obviously be sure to drag and drop your splash screen image into the root directory of your project.

Also, in the <initialWindow> section of bar-descriptor.xml, add:

    <aspectRatio>portrait</aspectRatio>
    <autoOrients>false</autoOrients>

Splash Screen for Portrait + Landscape App

The <splashscreen> tag allows you to specify both the landscape and portrait splash screens. To do that, you separate the file names with a colon. (:)

    <asset path="splashscreen_portrait.png">splashscreen_portrait.png</asset>
    <asset path="splashscreen_landscape.png">splashscreen_landscape.png</asset>
    <splashscreen>splashscreen_landscape.png:splashscreen_portrait.png</splashscreen>

Obviously be sure to drag and drop your splash screen image into the root directory of your project.

Also, in the <initialWindow> section of bar-descriptor.xml, add:

    <autoOrients>true</autoOrients>

See also:

Some documentation of the <splashscreen> tag

Search terms:

"bb10 splash screen", "bb10 splashscreen", "bb10 how to create a splash screen", "bb10 creating a splash screen"