{ "id": "87083", "key": "TIMOB-7837", "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": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" }, { "id": "13170", "name": "Sprint 2012-06", "archived": true, "released": true, "releaseDate": "2012-03-25" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-05-02T11:07:37.000+0000", "created": "2012-02-28T08:12:12.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "module_view", "parity", "qe-testadded" ], "versions": [ { "id": "12677", "description": "Release 1.8 Service Pack 1", "name": "Release 1.8.1", "archived": true, "released": true, "releaseDate": "2012-01-31" }, { "id": "13070", "description": "Release 1.8 Service Pack 2", "name": "Release 1.8.2", "archived": true, "released": true, "releaseDate": "2012-02-29" } ], "issuelinks": [ { "id": "15735", "type": { "id": "10011", "name": "Includes", "inward": "is included by", "outward": "includes" }, "inwardIssue": { "id": "86454", "key": "TIMOB-7643", "fields": { "summary": "Android: Implement the UI Composite Layout Behavior Spec", "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": "Critical", "id": "1" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } }, { "id": "15734", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "87082", "key": "TIMOB-7836", "fields": { "summary": "Android: View - height:'auto' causing view to be placed at the top of its parent rather than centering in the parent", "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": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "15429", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "87012", "key": "TIMOB-7819", "fields": { "summary": "Android: View - height:'auto' causing view to expand rather than contract to the size of its children", "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": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-05-02T11:07:37.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": "Setting the height of a view to 'auto' causes the child view to not be displayed. If you set the height to a constant value the the child view will be displayed.\r\n\r\nh4. Steps to reproduce:\r\nStep 1: run the code below\r\nStep 2: notice the the red view is not green (it would be green if clickView was visible).\r\nStep 3: in sectionHeader change \"height: 'auto'\" to \"height: 30\"\r\nStep 4: run the app again\r\nStep 5: notice that the red view is now green\r\n\r\n{code:title=app.js}\r\nvar win = Ti.UI.createWindow({backgroundColor:'white'});\r\nwin.open();\r\n\r\nvar section = createSectionView('TEST');\r\nwin.add(section);\r\n\r\nfunction createSectionView(text){\r\n\tvar sectionView = Ti.UI.createView({\r\n\t\theight: 'auto',\r\n\t\tlayout: 'vertical',\r\n\t});\r\n\t// using 'auto' here causes clickView to not be displayed\r\n\tvar sectionHeader = Ti.UI.createView({\r\n\t\theight: 'auto',\r\n\t\t// height: 30,\r\n\t\tbackgroundColor:'red',\r\n\t});\r\n\tvar sectionHeaderLabel = Ti.UI.createLabel({\r\n\t\ttext: text,\r\n\t\theight: 'auto',\r\n\t\ttop: 2,\r\n\t\tbottom: 3,\r\n\t\tleft: 10,\r\n\t\tright: 10,\r\n\t\tcolor: '#FFF',\r\n\t});\r\n\tvar clickView = Ti.UI.createView({\r\n\t\tbackgroundColor: 'green',\r\n\t\topacity: 0.5,\r\n\t});\r\n\t\r\n\tsectionView.add(sectionHeader);\r\n\tsectionHeader.add(sectionHeaderLabel);\r\n\tsectionHeader.add(clickView);\r\n\t\r\n\treturn sectionView;\r\n};\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: View - height:'auto' causing child view to not be displayed", "creator": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "TiSDK 1.8.1, V8\r\nTiSDK 1.8.2 (02/23/12 17:46 59b3a90), V8\r\nAndroid Emulator 2.3.3", "comment": { "comments": [ { "id": "184753", "author": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "IMHO, the problem is \"auto\" dimension value (percentage has similar problem). It can't be used in components that are composite (ScrollView and \"contentHeight/Width\", TableView and TableViewSection/TableViewRow). There are couple of tickets related to this, in one of them I suggested implementation of general behavior, so you might want to check it. ;)", "updateAuthor": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2012-03-01T02:05:50.000+0000", "updated": "2012-03-01T02:05:50.000+0000" }, { "id": "186355", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The behavior has changed since the composite layout spec. The auto behavior for height is different so the best thing to do is set a height. This should be tested in both iOS and android with the height set to 30, to verify parity. This needs to be tested as a part of https://github.com/appcelerator/titanium_mobile/pull/1659", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-13T16:53:59.000+0000", "updated": "2012-03-13T16:53:59.000+0000" }, { "id": "186811", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Resolving as a part of https://github.com/appcelerator/titanium_mobile/pull/1659", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-16T10:16:45.000+0000", "updated": "2012-03-16T10:16:45.000+0000" }, { "id": "187131", "author": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with 2.0.0.v20120319003254 with rhino/v8 on Android Emulator 2.3.3 and iPhone 5.0 with height set to auto and height to 30", "updateAuthor": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-19T12:05:25.000+0000", "updated": "2012-03-19T12:05:25.000+0000" }, { "id": "193450", "author": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Open to update label", "updateAuthor": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-05-02T11:07:12.000+0000", "updated": "2012-05-02T11:07:12.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }