{ "id": "154840", "key": "TIMOB-20380", "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": "17608", "name": "Release 6.1.0", "archived": false, "released": true, "releaseDate": "2017-05-26" } ], "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2017-05-05T13:35:39.000+0000", "created": "2016-02-10T16:49:25.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "autolayout", "module_scrollableview", "qe-5.2.0", "qe-testadded" ], "versions": [ { "id": "16997", "name": "Release 5.2.0", "archived": false, "released": true, "releaseDate": "2016-02-23" } ], "issuelinks": [], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-07-04T01:47:00.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": "When adding Views to a ScrollableView on Android, the views are not rendering inside the ScrollableView properly. This appears to be the result of the height and width parameters not being respected and defaulting to Ti.UI.FILL. As such setting the ScrollableView to have a height of Ti.UI.SIZE does nothing.\r\n\r\nThe expectation is that the internal Views would scale based on height and width parameters, and as such the ScrollableView would have a dynamic height based on the Ti.UI.SIZE declaration. In the attached screenshots you can see how this works on iOS (expected result) and on Android (incorrect result)\r\n\r\nCode Example:\r\nhttps://gist.github.com/grantges/ffbb0771adf091d15941", "attachment": [ { "id": "62184", "filename": "android.png", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-05-05T13:26:49.000+0000", "size": 9041, "mimeType": "image/png" }, { "id": "58182", "filename": "Screen Shot 2016-02-10 at 10.48.09 AM.png", "author": { "name": "bgrantges@appcelerator.com", "key": "bgrantges", "displayName": "Bert Grantges", "active": false, "timeZone": "America/Chicago" }, "created": "2016-02-10T16:48:36.000+0000", "size": 357823, "mimeType": "image/png" }, { "id": "58181", "filename": "Screen Shot 2016-02-10 at 10.48.22 AM.png", "author": { "name": "bgrantges@appcelerator.com", "key": "bgrantges", "displayName": "Bert Grantges", "active": false, "timeZone": "America/Chicago" }, "created": "2016-02-10T16:48:36.000+0000", "size": 361844, "mimeType": "image/png" } ], "flagged": false, "summary": "Android: Views height / width properties are not respected inside ScrollableView ", "creator": { "name": "bgrantges@appcelerator.com", "key": "bgrantges", "displayName": "Bert Grantges", "active": false, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "bgrantges@appcelerator.com", "key": "bgrantges", "displayName": "Bert Grantges", "active": false, "timeZone": "America/Chicago" }, "environment": null, "closedSprints": [ { "id": 883, "state": "closed", "name": "2017 Sprint 09 SDK", "startDate": "2017-04-23T21:46:54.309Z", "endDate": "2017-05-07T21:46:00.000Z", "completeDate": "2017-05-08T00:25:44.276Z", "originBoardId": 114 }, { "id": 796, "state": "closed", "name": "2017 Sprint 02 SDK", "startDate": "2017-01-15T00:00:41.845Z", "endDate": "2017-01-29T00:00:00.000Z", "completeDate": "2017-01-30T21:10:44.640Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "376552", "author": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "body": "I am seeing the same results.\r\n\r\nTested on:\r\nNexus 6p (6.0)\r\niOS Simulator (9.2)
\r\nMac OSX El Capitan 10.11.2
\r\nStudio: 4.5.0.201602100601\r\nTi SDK: 5.2.0.v20160210114026, 5.1.2 GA\r\n
Appc NPM: 4.2.3-2\r\n
App CLI: 5.2.0-254\r\n
Xcode 7.2
.1\r\nNode v4.2.4", "updateAuthor": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "created": "2016-02-10T21:59:31.000+0000", "updated": "2016-02-10T23:31:02.000+0000" }, { "id": "377808", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This is by design on Android. Views inside ScrollableView will behave as Ti.UI.FILL. I believe this is on the spec for layout.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-02-24T21:22:14.000+0000", "updated": "2016-02-25T09:22:29.000+0000" }, { "id": "377811", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Once Autolayout is fully implemented on iOS, this behavior will be the same as Android. This seems to be a bug on iOS. ScrollableViews have \"pages\". A page defined as a full-size view, which is a big as the ScrollableView viewing area. In other words, all the views passed in the {{views}} array will get a FILL width and height.", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-02-24T21:26:10.000+0000", "updated": "2016-02-24T21:26:10.000+0000" }, { "id": "419005", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "This is an Android-issue, not an iOS one. Here is why:\r\n* The problem is not with the default height values, it's with setting {{Ti.UI.Size}} to the ScrollableView\r\n* Labels always SIZE it's parent, so when no label height is given, it should receive the height of it's parent\r\n* On Android, the view height is not respected, although specified as {{Ti.UI.SIZE}}\r\n* On iOS, it is respected and the sub-view wraps properly\r\n\r\nSee this example:\r\n{code:js}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: '#fff'\r\n});\r\n\r\nvar view1 = Ti.UI.createView({\r\n backgroundColor: \"red\",\r\n height: 100,\r\n width: '90%'\r\n});\r\n\r\nvar label1 = Ti.UI.createLabel({\r\n text: 'View 1'\r\n});\r\n\r\nview1.add(label1);\r\n\r\nvar view2 = Ti.UI.createView({\r\n backgroundColor: \"green\",\r\n height: 100,\r\n width: '90%'\r\n});\r\n\r\nvar label2 = Ti.UI.createLabel({\r\n text: 'View 2'\r\n});\r\n\r\nview2.add(label2);\r\n\r\nvar scrollable = Ti.UI.createScrollableView({\r\n views: [view1, view2],\r\n width: Ti.UI.FILL,\r\n\theight: Ti.UI.SIZE,\r\n\ttop : \"30dip\"\r\n});\r\n\r\nwin.add(scrollable);\r\nwin.open();\r\n{code}\r\n\r\nPedro and Hieu both talked about the default view-behavior, which is indeed FILL. But if you use SIZE, it should still use it. Re-assigning to [~gmathews] for the Android platform. ", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-05-03T10:41:31.000+0000", "updated": "2017-05-03T10:41:31.000+0000" }, { "id": "419177", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-05-05T13:28:42.000+0000", "updated": "2017-05-05T13:35:52.000+0000" }, { "id": "423422", "author": { "name": "hini", "key": "hini", "displayName": "Hani Hamadeh", "active": true, "timeZone": "Asia/Beirut" }, "updateAuthor": { "name": "hini", "key": "hini", "displayName": "Hani Hamadeh", "active": true, "timeZone": "Asia/Beirut" }, "created": "2017-07-04T01:47:00.000+0000", "updated": "2017-07-04T01:47:00.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }