Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1674] Android splash screen stretched horizontally in landscape mode

GitHub Issuen/a
TypeNew Feature
Resolution Date2011-04-17T01:56:50.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.5.0 M02
Labelsandroid, default.png, feature, landscape, orientation, scaling, screen, splash
ReporterRalf Pfeiffer
AssigneeNolan Wright


On Android, the default.png splash screen image gets stretched to the full native screen size while it's displaying. This is reasonably ok when in portrait mode on most phones (though your image will be stretched a bit vertically on a Nexus 1 or Droid), but when in landscape mode the image actually changes orientation, and is now stretched vveerryy wwiiddee which doesn't look very good.

This is particularly bad on tablet/netbook form factors where you're more likely to be in landscape mode while launching an application.

For the moment I've worked around this in StatusNet Mobile by hacking up the resource settings to set the image to centered instead of stretched; this cuts off the top and bottom in landscape mode (but the core part of our image fits and looks correct), and will probably lead to a smaller-than-fullscreen image on tablet devices. Since this requires changing the generated resource files, I had to put another hack into our local fork of the library:

http://github.com/brion/titanium_mobile/commit/8f5586dd9f40b34e04c6ebc2bbfb31eaeb805da3"> http://github.com/brion/titanium_mobile/commit/8f5586dd9f40b34e04c6...

In researching this issue, I discovered that orientation-specific splash screens can be set up on iPad:
http://developer.appcelerator.com/question/24271/ipad-default-image-splash-screen-orientation-cutoff"> http://developer.appcelerator.com/question/24271/ipad-default-image...

Handy! It might be a good idea to include similar support for Android, but I'm not sure whether that can be easily implemented using the theme.xml background settings currently used for the splash screen.

Assigning to our support contact.


  1. Brion Vibber 2011-04-15

    It looks like portrait and landscape variants could be provided using alternate resource subdirs:

    http://developer.android.com/guide/topics/resources/providing-resources.html#AlternativeResources"> http://developer.android.com/guide/topics/resources/providing-resou...

    So something like this may work:
    default.png -> res/drawable/background.png default-landscape.png -> res/drawable-land/background.png * default-portrait.png -> res/drawable-port/background.png

  2. Don Thorp 2011-04-15

    Also see http://developer.appcelerator.com/helpdesk/view/46331">Helpdesk 46331

  3. Don Thorp 2011-04-15

    (from [a5d1f9ca078ebc5a16ede06c5ca2ea839ff09d0d]) [#1674 state:fixed-in-qa] Added support to detect configuration changes and use the correct splash screen. You need to place a file named background.png into the appropriate directories in /platform/android so that they get copied into the build. For example to have a medium density landscape background create the /platform/android/drawable-land-mdpi folder and put the appropriate background.png there. It must be named background.png because that is what the theme expects. To test simply put your device in the appropriate orientation and start the application. KitchenSink has been updated to have a graphic for landscape https://github.com/appcelerator/titanium_mobile/commit/a5d1f9ca078ebc5a16ede06c5ca2ea839ff09d0d"> https://github.com/appcelerator/titanium_mobile/commit/a5d1f9ca078e...

  4. Matt Schmulen 2011-04-15

    resolved, Thanks Opie. confirmed this fixed with 1.6/2.1

JSON Source