{ "id": "89327", "key": "TIMOB-8482", "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-02T04:09:39.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [], "versions": [ { "id": "13070", "description": "Release 1.8 Service Pack 2", "name": "Release 1.8.2", "archived": true, "released": true, "releaseDate": "2012-02-29" }, { "id": "13272", "description": "Release 2.0.1", "name": "Release 2.0.1", "archived": true, "released": true, "releaseDate": "2012-04-16" }, { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" } ], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:03:34.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h3. The problem\r\n\r\nComponents (Label and TextField in this case) added to the View are not showed on the screen in some cases.\r\n\r\nh3. Test case\r\n\r\n\r\nTo reproduce this issue, run the following example:\r\n\r\n{code}\r\nvar tabGroup = Ti.UI.createTabGroup();\r\n\r\nvar tab1 = Ti.UI.createTab({\r\n title: 'Tab 1',\r\n window: Ti.UI.createWindow()\r\n});\r\n\r\nvar tab2 = Ti.UI.createTab({\r\n title: 'Tab 2',\r\n window: Ti.UI.createWindow()\r\n});\r\n\r\ntabGroup.addTab(tab1);\r\ntabGroup.addTab(tab2);\r\n\r\n\r\nvar scrollView = Ti.UI.createScrollView({\r\n width: '100%',\r\n height: '100%',\r\n layout: 'horizontal',\r\n backgroundColor: '#f00',\r\n contentWidth: 'auto',\r\n contentHeight: 'auto'\r\n});\r\n\r\nvar view1 = Ti.UI.createView({\r\n width: '50%',\r\n height: 'auto',\r\n layout: 'vertical',\r\n top: 0,\r\n backgroundColor: '#00f'\r\n});\r\n\r\nvar view2 = Ti.UI.createView({\r\n width: '50%',\r\n top: 0,\r\n height: 'auto',\r\n layout: 'vertical',\r\n backgroundColor: '#0f0'\r\n});\r\n\r\nscrollView.add(view1);\r\nscrollView.add(view2);\r\n\r\nfor (var i = 0; i < 50; ++i) {\r\n \r\n var label = Ti.UI.createLabel({\r\n top: 10,\r\n //comment line below to see the components\r\n height: '10%',\r\n text: 'Label ' + i\r\n });\r\n \r\n var input = Ti.UI.createTextField({\r\n top: 10,\r\n //comment line below to see the components\r\n height: '10%',\r\n width: 200\r\n });\r\n \r\n view1.add(label);\r\n view2.add(input);\r\n}\r\n\r\ntab1.window.add(scrollView);\r\n\r\ntabGroup.open();\r\n{code}\r\n\r\n\r\nh3. The result\r\n\r\nAs you should see, two Views in ScrollView have 50% height and components added to them are not visible on the screen.\r\n\r\n\r\nh3. Expected result\r\n\r\n\r\nAll components should be visible on the screen. If component dimension defined as percentage is commented out, all components are visible on the screen.\r\n\r\n\r\nIn my opinion, components should be able to use percentages for dimension definition. In this particular case, component dimension should be looked up - because View has height defined as \"auto\" (and ScrollView's contentHeight is set to 'auto'), component size should be determined by the size of the Window (first component higher in the hierarchy that have defined dimension value - that could also be ScrollView because it has height defined as 100%). After that, View should calculate height according to the size of their child components (View have Labels and TextFields).", "attachment": [], "flagged": false, "summary": "Android: View doesn't show added components", "creator": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "* Titanium SDK version: 2.0.0 (03/30/12 10:32 b091bae)\r\n* Android 3.1\r\n* Thinkpad Tablet\r\n* Windows XP", "comment": { "comments": [ { "id": "189451", "author": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "body": "Tested and Confirmed this issue.", "updateAuthor": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "created": "2012-04-02T08:44:16.000+0000", "updated": "2012-04-02T08:44:16.000+0000" }, { "id": "195603", "author": { "name": "jyounus", "key": "jyounus", "displayName": "Junaid Younus", "active": true, "timeZone": "Europe/London" }, "body": "Tested with 2.0.1GA2 on a Samsung Galaxy S2, issue still exists.", "updateAuthor": { "name": "jyounus", "key": "jyounus", "displayName": "Junaid Younus", "active": true, "timeZone": "Europe/London" }, "created": "2012-05-22T10:54:53.000+0000", "updated": "2012-05-22T10:54:53.000+0000" }, { "id": "240688", "author": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The problem reproduce with release 3.0.2 and master release 3.1.0\n\ntested on\n\nTitanium Studio, build: 3.0.1.201212181159\nTitanium SDK version: 3.1.0 \nTitanium SDK version: 3.0.2 \nDevice: Samsung galaxy s duos Android version: 4.0.4\nAndroid Emulator: Android SDK version: 2.2\n\n\nI think there exist many issues related to the \"percentage\" unit.", "updateAuthor": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-05T10:43:50.000+0000", "updated": "2013-03-05T10:43:50.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }