{ "id": "120794", "key": "TIMOB-15398", "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-10-04T04:55:12.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "SupportTeam", "reprod" ], "versions": [ { "id": "15593", "description": "Release 3.1.3", "name": "Release 3.1.3", "archived": true, "released": true, "releaseDate": "2013-09-18" } ], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:04:25.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": "h4. Problem Description\r\nThe postlayout event is fired twice, therefore the callback is called twice as well.\r\n\r\nh4. Steps to reproduce\r\n1. Create a new mobile project (Classic Titanium)\r\n2. Paste the code sample to app.js\r\n3. Run the code in the simulator\r\n4. Please check the console when running, you will be able to see that the width and the height value are changing twice. They should change once. \r\n{code}\r\n[INFO] : e.source.rect.width 320\r\n[INFO] : e.source.rect.height 216\r\n[INFO] : e.source.rect.width 320\r\n[INFO] : e.source.rect.height 216\r\n{code}\r\n\r\n\r\nh4. Test case \r\n{code}\r\nvar win = Ti.UI.createWindow();\r\nvar btn = Ti.UI.createButton();\r\nwin.setLeftNavButton(btn);\r\n\r\nbtn.addEventListener('click', function(e) {\r\n\twin.close();\r\n});\r\n\r\nvar picker = Ti.UI.createPicker({\r\n\ttype : Ti.UI.PICKER_TYPE_DATE,\r\n\tminDate : new Date(2009, 0, 1),\r\n\tmaxDate : new Date(2014, 11, 31),\r\n\tvalue : new Date(2014, 3, 12),\r\n\tvisible : true\r\n});\r\n\r\nvar view = Ti.UI.createView({\r\n\tbottom : -279,\r\n\twidth : Ti.UI.SIZE,\r\n\theight : Ti.UI.SIZE\r\n});\r\n\r\nvar slide_in = Titanium.UI.createAnimation({\r\n\tbottom : 0,\r\n\tduration : 200,\r\n\r\n});\r\nvar slide_out = Titanium.UI.createAnimation({\r\n\tbottom : -304,\r\n\tduration : 200\r\n});\r\n\r\nview.addEventListener(\"postlayout\", function(e) {\r\n\tTi.API.info('e.source.rect.width'+e.source.rect.width);\r\n\tTi.API.info('e.source.rect.height'+e.source.rect.height);\r\n});\r\n\r\nview.add(picker);\r\nwin.add(view); \r\n\r\nwin.open();\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "iOS: View - postLayout event gets called twice", "creator": { "name": "jialhe85@gmail.com", "key": "jialhe85@gmail.com", "displayName": "David He", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jialhe85@gmail.com", "key": "jialhe85@gmail.com", "displayName": "David He", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "OS: MAC OX X 10.8.5\r\niOS SDK: 7.0,Xcode 5\r\niOS Simulator: 6.0\r\nTi SDK: 3.1.2 GA,3.1.3 GA\r\nTi CLI: 3.1.2\r\n", "comment": { "comments": [ { "id": "317697", "author": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Issue reproduces \r\nTitanium Command-Line Interface, \r\nCLI version 3.3.0, \r\nTitanium SDK version 3.3.0.GA \r\niOS SDK: 7.1 \r\niOS iPhone Simulator: 7.1", "updateAuthor": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-08-08T11:01:52.000+0000", "updated": "2014-08-08T11:01:52.000+0000" }, { "id": "420296", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Can confirm that this is still an issue. Tested with the following environment;\r\niPhone 7 (10.2)\r\nMacOS 10.11.6 (15G31)\r\nStudio 4.9.0.201705021158\r\nTi SDK 6.1.0.v20170519131839\r\nAppc NPM 4.2.9\r\nAppc CLI 6.2.1\r\nTi CLI 5.0.13\r\nAlloy 1.9.11\r\nArrow 2.0.0\r\nXcode 8.2 (8C38)\r\nNode v4.8.2\r\nJava 1.7.0_80", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-05-23T21:45:01.000+0000", "updated": "2017-05-23T21:45:01.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }