{ "id": "142257", "key": "TIMOB-18307", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2015-01-05T20:00:06.000+0000", "priority": null, "labels": [ "Ti.App.Android.R", "drawable" ], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-02-28T19:54:54.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "The attached test project shows that an image in the application resources *can* be used as an image, but not as a backgroundImage.\r\n\r\nh1. Problem\r\nThe first View will not display the 9-patch image located in {{platform/android/res}}; this is the actual problem. The second ImageView *will* display the image in {{platform/android/res}}, but since it 9-patch is only supported for backgrounds it is stretched. The third View displays the same 9-patch image in {{Resources/images}} as expected.\r\n\r\nh1. Use case\r\nWhat I wan to do is re-use the launch image as a background later in the app. Of course I can keep additional copies for all densities in but this increases the size of the app largely.\r\n\r\nh1. Code from the attached project\r\n\r\n{code:javascript}\r\nvar win = Ti.UI.createWindow();\r\n\r\nwin.add(Ti.UI.createView({\r\n top: 0,\r\n left: 0,\r\n\r\n width: '33%',\r\n height: Ti.UI.FILL,\r\n\r\n backgroundColor: 'red',\r\n backgroundImage: Ti.App.Android.R.drawable.drawablenine\r\n}));\r\n\r\nwin.add(Ti.UI.createImageView({\r\n top: 0,\r\n left: '33%',\r\n\r\n width: '34%',\r\n height: Ti.UI.FILL,\r\n\r\n backgroundColor: 'green',\r\n image: Ti.App.Android.R.drawable.drawablenine\r\n}));\r\n\r\nwin.add(Ti.UI.createView({\r\n top: 0,\r\n right: 0,\r\n\r\n width: '33%',\r\n height: Ti.UI.FILL,\r\n\r\n backgroundColor: 'blue',\r\n backgroundImage: '/images/resourcesnine.png'\r\n}));\r\n\r\nwin.open();\r\n{code}", "attachment": [ { "id": "53407", "filename": "android_20150105-212740.png", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-01-05T20:27:54.000+0000", "size": 104798, "mimeType": "image/png" }, { "id": "53408", "filename": "bg.zip", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-01-05T20:28:15.000+0000", "size": 45811, "mimeType": "application/zip" } ], "flagged": false, "summary": "Android: backgroundImage doesn't load application resources", "creator": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "3.5.0.RC", "comment": { "comments": [], "maxResults": 1, "total": 1, "startAt": 0 } } }