{ "id": "93733", "key": "TIMOB-10004", "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": "2012-06-24T05:53:43.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "api", "parity" ], "versions": [ { "id": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" } ], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:04:14.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "The left offset for views added after leftImage to a tableviewrow differs between iOS and Android\r\nOn iOS it seems to be 0, whereas on android it is the size of the image.\r\nSo for consistent behaviour a work around that alters the left property of views is required\r\n\r\n{code}\r\n// This is a single context application with mutliple windows in a stack\r\n(function() {\t\r\n\tvar self = Titanium.UI.createWindow({\r\n title: 'Window',\r\n backgroundColor: 'white',\r\n }); \r\n\r\n var tableview = Ti.UI.createTableView({});\r\n\r\n var lbl = Ti.UI.createLabel({\r\n text: 'Label to the right of the left image',\r\n font: {\r\n fontSize : '16dp'\r\n },\r\n textAlign: 'left',\r\n left: 0,\r\n });\r\n\r\n var row = Ti.UI.createTableViewRow({\r\n className: 'datarow',\r\n height: '77dp',\r\n leftImage: '/KS_nav_views.png'\r\n });\r\n row.add(lbl);\r\n tableview.appendRow(row);\r\n \r\n self.add(tableview);\r\n self.open();\r\n})();\r\n{code}\r\n\r\nUsing the title property in the row puts the text as expected, i.e. to the right of the image\r\n{code}\r\n(function() {\t\r\n\tvar self = Titanium.UI.createWindow({\r\n title: 'Window',\r\n backgroundColor: 'white',\r\n }); \r\n\r\n var tableview = Ti.UI.createTableView({});\r\n\r\n var row = Ti.UI.createTableViewRow({\r\n title: 'Test'\r\n className: 'datarow',\r\n height: '77dp',\r\n leftImage: '/KS_nav_views.png'\r\n });\r\n\r\n tableview.appendRow(row);\r\n \r\n self.add(tableview);\r\n self.open();\r\n})();\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Android: LeftImage inconsistent left position", "creator": { "name": "ndastur", "key": "ndastur", "displayName": "Neville Dastur", "active": true, "timeZone": "Europe/London" }, "subtasks": [], "reporter": { "name": "ndastur", "key": "ndastur", "displayName": "Neville Dastur", "active": true, "timeZone": "Europe/London" }, "environment": "SDK 2.0.2\r\niOS 5.0\r\nAndroid 2.3.3\r\nRuntime V8", "comment": { "comments": [ { "id": "201376", "author": { "name": "anagesh", "key": "anagesh", "displayName": "Anirudh Nagesh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Is it leftImage or backGroundImage? The issue is not clear. Sample code does not reproduce the issue.\r\nWOrks fine with left:0 on both Android and iOS. \r\nhttps://gist.github.com/9eb2ba10f35a7ab155a3", "updateAuthor": { "name": "anagesh", "key": "anagesh", "displayName": "Anirudh Nagesh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-03T12:45:45.000+0000", "updated": "2012-07-03T12:45:45.000+0000" }, { "id": "201386", "author": { "name": "ndastur", "key": "ndastur", "displayName": "Neville Dastur", "active": true, "timeZone": "Europe/London" }, "body": "The original code that I posted was incorrect as you rightly pointed. Since then I have created a little bug project and so it's much easier to make minimal cases. The code that show the error is now in the description", "updateAuthor": { "name": "ndastur", "key": "ndastur", "displayName": "Neville Dastur", "active": true, "timeZone": "Europe/London" }, "created": "2012-07-03T13:15:01.000+0000", "updated": "2012-07-03T13:15:01.000+0000" }, { "id": "201443", "author": { "name": "anagesh", "key": "anagesh", "displayName": "Anirudh Nagesh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi,\r\n\r\nYes, I see the behavior now. I believe its a parity issue. I will discuss this with the engineering team. Meanwhile, you can use the workaround below.\r\n\r\n{code}\r\n if(Ti.Platform.name == 'android') leftMargin = '0dp'; else leftMargin = '58dp';\r\n var label = Ti.UI.createLabel({\r\n text: 'Label to the right of the left image',\r\n font: {\r\n fontSize : '16dp'\r\n },\r\n textAlign: 'left',\r\n left:leftMargin,\r\n //right:10,\r\n });\r\n{code}\r\n\r\nRegards,\r\nAnirudh", "updateAuthor": { "name": "anagesh", "key": "anagesh", "displayName": "Anirudh Nagesh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-03T15:35:32.000+0000", "updated": "2012-07-03T15:35:32.000+0000" }, { "id": "201448", "author": { "name": "ndastur", "key": "ndastur", "displayName": "Neville Dastur", "active": true, "timeZone": "Europe/London" }, "body": "No problem. Not that I think the workaround will depend on the left image size.\r\nAnd BTW it is still present on SDK 2.1.0\r\n\r\nThanks", "updateAuthor": { "name": "ndastur", "key": "ndastur", "displayName": "Neville Dastur", "active": true, "timeZone": "Europe/London" }, "created": "2012-07-03T15:45:51.000+0000", "updated": "2012-07-03T15:46:34.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }