Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4623] Problem with Android 9 Patch Images on 1.7.1

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionInvalid
Resolution Date2011-07-08T10:38:19.000+0000
Affected Version/sRelease 1.7.1
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterRick Blalock
AssigneeDon Thorp
Created2011-07-08T08:34:04.000+0000
Updated2012-03-05T08:57:54.000+0000

Description

9 patch/slice/scale (whatever you want to call it) images are not showing up in 1.7.1. Previous to 1.7.1 the attached project and code worked.
    var mainWindow = Titanium.UI.createWindow(
    {
        backgroundColor: "white"
    });

    var button = Titanium.UI.createButton(
    {
        title: "Help", 
        width: 200, 
        height: 30,
        backgroundLeftCap : 5,
        backgroundTopCap : 0,
        backgroundImage: "images/header.png"
    });
    mainWindow.add(button);
    mainWindow.open();

Attachments

FileDateSize
exampleshots.zip2011-07-08T08:34:04.000+000039118
StudioTest.zip2011-07-08T08:34:04.000+00002560061

Comments

  1. Don Thorp 2011-07-08

    9 Patch images MUST be named with .9.png. Also they should be using the density versions now and not loading them on the fly out of the images directory.
  2. Jon Alter 2011-07-08

    If your image is named "header.9.png" you will want to refer to is as "header.png" and not "header.9.png". Also, if you have an image named "header.png" in the Resources directory, it will override the image in the density specific folder.
  3. Rick Blalock 2011-07-14

    Don, Are we expecting users to be forced to detect the platform in order to load the appropriate image?
  4. Hart Woolery 2011-08-15

    I think it'd be more efficient to be able to use a single 9-patch image universally or a single non-9-patch image universally... something like this could be easily integrated into the iphone side: http://blog.tortuga22.com/2010/05/31/announcing-tortuga-22-ninepatch/ Either way, I am unable to get 9 patch images working on the Android side under 1.7.2, can't find any working examples...
  5. Paul Dowsett 2012-03-05

    Hart I have posted instructions to the Q&A in [this thread](http://developer.appcelerator.com/question/133224/9-patch-images---android#232432), and also intend to add this information to the apidocs. Hope it helps

JSON Source