{ "id": "117377", "key": "TIMOB-14634", "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": "2013-07-19T01:09:47.000+0000", "priority": null, "labels": [ "android", "parity", "scrollableView" ], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:03:57.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": [], "description": "h6.Problem\r\nI have x amount of ImageViews that are all different sizes. For each ImageView I have captions (labels) that overlay the image and the coords are set by a left/top percentage. The problem is the only way to currently retrieve these views is to get a reference to the currentview and call the toImage method to get the size. I would think by adding a post layout to each view or to the ScrollableView you should be able to get that views size when it is scrolled to.\r\n\r\nh6.Snippet\r\n{code}\r\nvar imageViewArray = [];\r\nvar colors = ['red', 'orange', 'yellow'];\r\n\r\nfor (var c = 0; c < colors.length; c++) {\r\n\t//Views work, ImageViews do not.\r\n\tvar iv = Ti.UI.createImageView({\r\n\t//var iv = Ti.UI.createView({ //it works\t\r\n\t\tbackgroundColor : colors[c],\r\n\t\twidth : '100%',\r\n\t\theight : '100%'\r\n\t});\r\n\r\n\tiv.addEventListener('postlayout', function() {\r\n\t\t//alert('hoping this would work ');\r\n\t\tTi.API.info(' hoping this would work: ' + c);\r\n\t});\r\n\r\n\timageViewArray.push(iv);\r\n}\r\n\r\nvar self = Titanium.UI.createScrollableView({\r\n\tviews : imageViewArray,\r\n\tcurrentPage : 0,\r\n});\r\nself.addEventListener('postlayout', function() {\r\n\talert('this only is for Scrollableview');\r\n}); \r\n\r\nvar win = Ti.UI.createWindow();\r\nwin.add(self);\r\nwin.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: Postlayout event does not fire on ImageViews that are in a ScrollableView", "creator": { "name": "aroyce", "key": "aroyce", "displayName": "Andrew Royce", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "aroyce", "key": "aroyce", "displayName": "Andrew Royce", "active": true, "timeZone": "America/New_York" }, "environment": "Android using TiSDK 3.1.1 \r\nStudio 3.1.1.201306112235", "comment": { "comments": [ { "id": "262395", "author": { "name": "aroyce", "key": "aroyce", "displayName": "Andrew Royce", "active": true, "timeZone": "America/New_York" }, "body": "[Moved to description]", "updateAuthor": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-07-19T01:21:21.000+0000", "updated": "2013-07-23T21:43:54.000+0000" }, { "id": "265912", "author": { "name": "aroyce", "key": "aroyce", "displayName": "Andrew Royce", "active": true, "timeZone": "America/New_York" }, "body": "Do you need anything else from me to get this pushed closer to a fix?", "updateAuthor": { "name": "aroyce", "key": "aroyce", "displayName": "Andrew Royce", "active": true, "timeZone": "America/New_York" }, "created": "2013-08-11T21:41:01.000+0000", "updated": "2013-08-11T21:41:01.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }