{ "id": "98714", "key": "TIMOB-10396", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": "2012-08-06T08:51:56.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "community", "core" ], "versions": [ { "id": "13572", "description": "Release 2.1.1", "name": "Release 2.1.1", "archived": true, "released": true, "releaseDate": "2012-07-31" } ], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:03:19.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": "backgroundImage : 'test.png'\r\n\r\nAndroid will look for the image. If it can't find it, it will look for 'test.9.png'\r\n\r\nI suggest the opposite\r\n\r\nAndroid first looks for test.9.png, if it can't find it, it will look for 'test.png'\r\n\r\nThat way you don't need any branching code in your app if you are writing for Android and iOS simultaneously\r\n\r\nInstead of:\r\n\r\nbackgroundImage : Ti.Platform.osname == 'android' ? 'test.png' : 'test_ios.png'\r\n\r\nyou could simply go:\r\n\r\nbackgroundImage : 'test.png'\r\n\r\nHere is some testcode. Copy the attached images to the root of Resources/ - then build. You'll clearly see that Android is using 'test.png' stretched raw, rather than using 'test.9.png'. \r\n\r\nThen delete or rename test.png, and build again (you may or may not need to clean project) and build again - now it works.\r\n\r\n~~~\r\nvar win = Ti.UI.createWindow(\r\n{\r\n\tbackgroundColor : 'white',\r\n\texitOnClose : true,\r\n\tfullscreen : false,\r\n\ttitle : 'Click button to test'\r\n});\r\n\r\nvar button = Ti.UI.createButton(\r\n{\r\n\tbackgroundImage : '/test.png',\r\n\tbackgroundSelectedImage : '/test.png',\r\n\ttitle : 'Click me!',\r\n\ttop : 10,\r\n\twidth : 300,\r\n\theight : 200\r\n});\r\n\r\n\r\nbutton.addEventListener('click', function(e) {\r\n\tTi.API.info(\"You clicked the button\");\r\n});\r\n\r\nwin.add(button);\r\nwin.open()\r\n~~~\r\n\r\n\r\n", "attachment": [ { "id": "30286", "filename": "test.9.png", "author": { "name": "acebone", "key": "acebone", "displayName": "Esben Maaløe", "active": true, "timeZone": "Europe/Berlin" }, "created": "2012-08-06T08:51:56.000+0000", "size": 348, "mimeType": "image/png" }, { "id": "30287", "filename": "test.png", "author": { "name": "acebone", "key": "acebone", "displayName": "Esben Maaløe", "active": true, "timeZone": "Europe/Berlin" }, "created": "2012-08-06T08:51:56.000+0000", "size": 352, "mimeType": "image/png" } ], "flagged": false, "summary": "TiAPI: 9-patch workflow enhancements", "creator": { "name": "acebone", "key": "acebone", "displayName": "Esben Maaløe", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "acebone", "key": "acebone", "displayName": "Esben Maaløe", "active": true, "timeZone": "Europe/Berlin" }, "environment": "This pertains to TiSDK, so all platforms are relevant here, but I tested on:\r\n\r\nUbuntu Linux 12.04\r\nTitanium Studio, build: 2.1.1.201207271312\r\nTiSDK 2.1.1GA", "comment": { "comments": [], "maxResults": 0, "total": 0, "startAt": 0 } } }