{ "id": "99421", "key": "TIMOB-11019", "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": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" }, { "id": "14621", "description": "2012 Sprint 23 API", "name": "2012 Sprint 23 API", "archived": true, "released": true, "releaseDate": "2012-11-19" }, { "id": "14623", "description": "2012 Sprint 23 JS", "name": "2012 Sprint 23", "archived": true, "released": true, "releaseDate": "2012-11-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-11-13T19:47:08.000+0000", "created": "2012-08-20T04:30:28.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "core", "layout", "module_scrollview", "qe-testadded" ], "versions": [ { "id": "14096", "description": "Release 2.1.2", "name": "Release 2.1.2", "archived": true, "released": true, "releaseDate": "2012-08-31" } ], "issuelinks": [], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2013-07-26T11:15:57.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h2. Problem\r\n\r\nScrollView does not show elements when using \"horizontal\" layout.\r\n\r\nh2. Test case\r\n\r\nTo see this issue run this example: \r\n\r\n{code}\r\nfunction createContent() {\r\n    var wrapper = Ti.UI.createView({\r\n        width: Ti.UI.FILL,\r\n        height: Ti.UI.SIZE,\r\n        backgroundColor: '#f00',\r\n\t\thorizontalWrap: true,\r\n        layout: 'horizontal'\r\n    });\r\n     \r\n    var label1 = Ti.UI.createLabel({\r\n        text: 'Label 1',\r\n        width: '50%'\r\n    });\r\n     \r\n    var cb1 = Ti.UI.createSwitch({\r\n        value: false\r\n    });\r\n     \r\n    wrapper.add(label1);\r\n    wrapper.add(cb1);\r\n     \r\n    return wrapper;\r\n}\r\n \r\nvar win = Ti.UI.createWindow({\r\n    navBarHidden: true\r\n});\r\n \r\nvar scrollView = Ti.UI.createScrollView({\r\n    height: Ti.UI.FILL,\r\n    width: Ti.UI.FILL,\r\n    backgroundColor: '#0f0',\r\n    layout: 'horizontal',\r\n    //layout: 'vertical',\r\n    contentHeight: Ti.UI.SIZE,\r\n    contentWidth: Ti.UI.FILL\r\n});\r\n \r\nwin.add(scrollView);\r\n \r\nfor (var i = 0; i < 10; ++i) {\r\n    scrollView.add(createContent());\r\n}\r\n \r\nvar table = Ti.UI.createTableView({\r\n    backgroundColor: '#00f',\r\n    height: Ti.UI.SIZE\r\n});\r\n \r\nscrollView.add(table);\r\n \r\nvar rows = [];\r\nfor (i = 0; i < 25; ++i) {\r\n    rows.push({ title: 'Row ' + i});\r\n}\r\n \r\ntable.setData(rows);\r\n \r\nwin.open();\r\n{code}\r\n\r\n\r\nYou should see only first row (Label1 and switch)\r\n\r\nh2. Expected result\r\n\r\nAll data should be visible, like it is on Android (run this example on Android to see how it looks)", "attachment": [], "flagged": false, "summary": "iOS: horizontalWrap for scrollviews with horizontal layouts do not work when there are nested views", "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 2.2.0.v20120817153314\r\n* iOS 5.1 simulator\r\n* OSX ML", "comment": { "comments": [ { "id": "219933", "author": { "name": "btran", "key": "btran", "displayName": "Betty Tran", "active": true, "timeZone": "America/Los_Angeles" }, "body": "To elaborate on the problem described above:\r\n\r\nWhen there is a scrollview with layout: horizontal and horizontalWrap: true, the horizontalWrap property works as expected when adding many views to the scroll view. However, if we add an item (a label, button or view for example) to the view the horizontalWrap property does not work and the views continue to be placed horizontally until they do not appear.\r\n\r\nThe following is a simplified example:\r\n\r\n{code}\r\nfunction createContent() {\r\n var wrapper = Ti.UI.createView({\r\n width: 200,\r\n height: 100,\r\n backgroundColor: 'pink',\r\n });\r\n \r\n var label1 = Ti.UI.createView({\r\n \theight: 100,\r\n \twidth: 100,\r\n \tbackgroundColor: 'red'\r\n });\r\n \r\n wrapper.add(label1);\r\n \r\n return wrapper;\r\n}\r\n \r\nvar win = Ti.UI.createWindow({\r\n navBarHidden: true\r\n});\r\n \r\nvar scrollView = Ti.UI.createScrollView({\r\n height: Ti.UI.FILL,\r\n width: Ti.UI.FILL,\r\n backgroundColor: '#0f0',\r\n layout: 'horizontal',\r\n horizontalWrap: true,\r\n contentHeight: Ti.UI.SIZE,\r\n contentWidth: Ti.UI.FILL\r\n});\r\n \r\nwin.add(scrollView);\r\n \r\nfor (var i = 0; i < 10; ++i) {\r\n scrollView.add(createContent());\r\n}\r\n \r\nwin.open();\r\n{code}\r\n\r\nIf we do not add the label to the view, then horizontalWrap: true behaves as expected.", "updateAuthor": { "name": "btran", "key": "btran", "displayName": "Betty Tran", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-09-20T09:25:37.000+0000", "updated": "2012-09-20T09:25:37.000+0000" }, { "id": "226753", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Pull pending https://github.com/appcelerator/titanium_mobile/pull/3396", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-11-08T20:03:01.000+0000", "updated": "2012-11-08T20:03:01.000+0000" }, { "id": "235112", "author": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Environment used for verification -\r\nTitanium SDK: 3.1.0.v20130114171802\r\nTitanium  Studio: 3.0.1.201212181159\r\nDevice : Simulator iOS 6.0, iPHONE 3G S iOS 5.0.1", "updateAuthor": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-21T12:21:27.000+0000", "updated": "2013-01-21T12:21:27.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }