[TIMOB-4623] Problem with Android 9 Patch Images on 1.7.1
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2011-07-08T10:38:19.000+0000 |
Affected Version/s | Release 1.7.1 |
Fix Version/s | n/a |
Components | Android |
Labels | n/a |
Reporter | Rick Blalock |
Assignee | Don Thorp |
Created | 2011-07-08T08:34:04.000+0000 |
Updated | 2012-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
File | Date | Size |
---|---|---|
exampleshots.zip | 2011-07-08T08:34:04.000+0000 | 39118 |
StudioTest.zip | 2011-07-08T08:34:04.000+0000 | 2560061 |
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.
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.
Don, Are we expecting users to be forced to detect the platform in order to load the appropriate image?
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...
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