{ "id": "82633", "key": "TIMOB-6155", "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": [ { "id": "13272", "description": "Release 2.0.1", "name": "Release 2.0.1", "archived": true, "released": true, "releaseDate": "2012-04-16" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-08-01T04:27:12.000+0000", "created": "2011-11-11T10:16:20.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "module_view", "qe-testadded" ], "versions": [ { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" } ], "issuelinks": [], "assignee": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-11-05T10:12:23.000+0000", "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" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h3. Problem:\r\nI have a scrollView with a vertical layout and a bunch of views. Depending on the content, some of these views need to hide and the views after that one need to be repositioned.\r\nh3. Example code:\r\n{code}\r\nvar win = Ti.UI.createWindow({backgroundColor:'black'});\r\n\r\nvar scrollView = Ti.UI.createScrollView({\r\n\tlayout:'vertical',\r\n\tcontentHeight:'auto',\r\n\ttop:0,bottom:0,left:0,right:0\r\n});\r\nwin.add(scrollView);\r\nwin.open();\r\n\r\nvar len = 2;\r\n\r\nfor(var i = 0; i < len; i++){\r\n\tscrollView.add(\r\n\t\tTi.UI.createView({\r\n\t\t\ttop:5,\r\n\t\t\tleft:20,\r\n\t\t\tright:20,\r\n\t\t\tbackgroundColor:'white',\r\n\t\t\theight:80\r\n\t\t})\r\n\t);\r\n}\r\n\r\nvar magicView = Ti.UI.createView({\r\n\ttop:5,\r\n\tleft:30,\r\n\tright:30,\r\n\tbackgroundColor:'red',\r\n\theight:100\r\n});\r\nvar viewThatWillGetPushedToTheTop = Ti.UI.createView({\r\n\ttop:5,\r\n\tleft:30,\r\n\tright:30,\r\n\tbackgroundColor:'green',\r\n\theight:100\r\n});\r\n\r\nscrollView.add(magicView);\r\nscrollView.add(viewThatWillGetPushedToTheTop);\r\n\r\nfor(var i = 0; i < len; i++){\r\n\tscrollView.add(\r\n\t\tTi.UI.createView({\r\n\t\t\ttop:5,\r\n\t\t\tleft:20,\r\n\t\t\tright:20,\r\n\t\t\tbackgroundColor:'white',\r\n\t\t\theight:80\r\n\t\t})\r\n\t)\r\n}\r\n\r\nscrollView.add(Ti.UI.createView({backgroundColor:'blue',height:100,top:10}))\r\n\r\nsetTimeout(function(){\r\n\tmagicView.hide();\r\n\tviewThatWillGetPushedToTheTop.top -= magicView.height\r\n},4000);\r\n{code}\r\nh3. Explanation:\r\nSo, here we have a simple window with a scrollView. In the scrollView there are two white views, a red view, a green view, two more white views, and a blue one. After a 4 second timer, I remove the red view and push back the green view. When this happens, you'll see that the last view, the blue one (which is 100px height) will be cut off at the middle.", "attachment": [], "flagged": false, "summary": "Android: Hiding a view and changing the height of another in a vertical layout scrollview cuts off the contentHeight early", "creator": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "environment": "Android SDK 2.2\r\nTi SDK 1.8.0.v20111110184258", "comment": { "comments": [ { "id": "195195", "author": { "name": "jyounus", "key": "jyounus", "displayName": "Junaid Younus", "active": true, "timeZone": "Europe/London" }, "body": "Tested with 2.0.1GA2 on a Samsung Galaxy S2 and I'm unable to reproduce this issue. Ticket closed.", "updateAuthor": { "name": "jyounus", "key": "jyounus", "displayName": "Junaid Younus", "active": true, "timeZone": "Europe/London" }, "created": "2012-05-17T13:53:11.000+0000", "updated": "2012-05-17T13:53:11.000+0000" }, { "id": "207913", "author": { "name": "rumbrasas", "key": "rumbrasas", "displayName": "Rima Umbrasas", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed on Tested on:\r\nTitanium SDK: 2.2.0.v20120716092112\r\nTitanium Studio, build: 2.1.1.201207121732\r\n and device Android 3.2", "updateAuthor": { "name": "rumbrasas", "key": "rumbrasas", "displayName": "Rima Umbrasas", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-16T17:19:38.000+0000", "updated": "2012-07-16T17:19:38.000+0000" }, { "id": "210958", "author": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Re-opening to edit label", "updateAuthor": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-01T04:26:16.000+0000", "updated": "2012-08-01T04:26:16.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }