{ "id": "90950", "key": "TIMOB-9305", "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-04-27T03:40:02.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "autoheight", "layout", "reprod", "scrollview" ], "versions": [], "issuelinks": [ { "id": "17490", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "92293", "key": "TIMOB-9225", "fields": { "summary": "iOS: Review composite layout feature requests", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } } ], "assignee": null, "updated": "2018-02-28T20:03:24.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": "h1. Intro\r\n\r\nI just started migrating my app from sdk1.8.2 to 2.0.1.GA2 and I am having issues with my views inside tableviews .. I think the one in fault here is the view that doesn't actualize its automatic height once it reaches the screen height.\r\n\r\nh1. Test Case\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({backgroundColor: 'white'});\r\n \r\nvar scroll = Ti.UI.createScrollView({\r\n top:0, left:0, right:0, bottom:0,\r\n contentHeight:'auto',\r\n});\r\n \r\nvar itemsView = Ti.UI.createView({\r\n layout:'vertical',\r\n height:Ti.UI.SIZE\r\n});\r\nitemsView.addEventListener('postlayout', function(){\r\n\tTi.API.info('width='+itemsView.size.width+' & height='+itemsView.size.height);\r\n});\r\n\r\nfunction addLabels() {\r\n\tTi.API.info('Calling addLabels');\r\n\tvar colors = ['red','green','grey'];\r\n\tfor(var i = 0; i < 6; i++) {\r\n\t itemsView.add(Ti.UI.createLabel({\r\n\t width:Ti.UI.FILL, height:80,\r\n\t textAlign:'center',\r\n\t text: 'dodoah ' + i,\r\n\t backgroundColor: colors[i%3],\r\n\t })); \r\n\t}\r\n}\r\n\r\naddLabels();\r\nsetTimeout(addLabels, 2000);\r\n \r\nscroll.add(itemsView);\r\n \r\nwin.add(scroll);\r\nwin.open();\r\n\r\nsetTimeout(function(){\r\n\tTi.API.info('Opening window');\r\n\tvar modal = Ti.UI.createWindow({\r\n\t\ttitle:'Modal',\r\n\t\tbackgroundColor:'white'\r\n\t});\r\n\tmodal.open({ modal:true });\r\n\tsetTimeout(function(){\r\n\t\tTi.API.info('Closing window');\r\n\t\tmodal.close();\r\n\t}, 1000);\r\n}, 5000);\r\n{code}\r\n\r\nh1. Problem\r\n\r\n{quote}\r\n[INFO] Application started\r\n[INFO] test/1.0 (2.0.2.v20120418121806.0684d32)\r\n[INFO] Calling addLabels\r\n[INFO] width=320 & height=480\r\n...\r\n[INFO] width=320 & height=480\r\n[INFO] Calling addLabels\r\n[INFO] width=320 & height=560\r\n[INFO] width=320 & height=560\r\n[INFO] Opening window\r\n[INFO] width=320 & height=960\r\n[INFO] width=320 & height=960\r\n[INFO] Closing window\r\n[INFO] width=320 & height=960\r\n...\r\n{quote}\r\n\r\nAfter 2 seconds, there should be 12 labels on top of each other, but only 7 appear. You can only see the rest after a redraw action (in this case, a modal window, but a regular window or even a keyboard would do the trick).\r\n\r\nAs you can see, there are only two postlayout events after the second call and the size does not correspond to 6 * 80 pixels labels added. As soon as the modal window opens, new postlayout events are called but this time with the right height.\r\n\r\nh1. Note\r\n\r\nI know a tableview would work just fine in this case, but it is just a basic sample code to show you the but i am having with more complicated code.\r\n\r\nAnd the problem also appears with a horizontal layout.", "attachment": [], "flagged": false, "summary": "iOS: Vertical layout View inside ScrollView bug", "creator": { "name": "tidam", "key": "tidam", "displayName": "Damien Meurisse", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "tidam", "key": "tidam", "displayName": "Damien Meurisse", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "* Titanium SDK version: Titanium Mobile 2.0.1.GA2\r\n* Titanium SDK version: Titanium Mobile 2.0.2.v20120418121806\r\n* iPhone iOS 5.1 emulator on Lion", "comment": { "comments": [ { "id": "194504", "author": { "name": "tidam", "key": "tidam", "displayName": "Damien Meurisse", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi, it's been almost 2 weeks now, and i am a little surprise nobody commented, not even other developers. It makes me wonder how other developers build their apps, because to me it is a blocking bug :/", "updateAuthor": { "name": "tidam", "key": "tidam", "displayName": "Damien Meurisse", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-05-11T07:05:18.000+0000", "updated": "2012-05-11T07:05:18.000+0000" }, { "id": "195938", "author": { "name": "tidam", "key": "tidam", "displayName": "Damien Meurisse", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I tried with the 2.0.2.v20120522180515.0f37aba CI build, it works if I manually ask the scrollview to recalculate its contentHeight ! I just added \r\n scroll.contentHeight = 'auto';\r\nat the end of my playing with the views (remove / add). I'd say it still is a bug because it doesn't do it by itself, but at least, I can work !", "updateAuthor": { "name": "tidam", "key": "tidam", "displayName": "Damien Meurisse", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-05-24T08:56:44.000+0000", "updated": "2012-05-24T08:56:44.000+0000" }, { "id": "196393", "author": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Definitely a bug. Should be addressed.", "updateAuthor": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-05-29T16:58:55.000+0000", "updated": "2012-05-29T16:58:55.000+0000" }, { "id": "422242", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "I am able to reproduce this issue with the following environment;\r\niPhone 7 (10.2)\r\nStudio 4.9.0.201705302345\r\nTi SDK 6.1.1.v20170609091155\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.8.0_131", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-06-19T16:57:09.000+0000", "updated": "2017-06-19T16:57:09.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }