{ "id": "86144", "key": "TIMOB-7561", "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": "12096", "description": "", "name": "Sprint 2012-04", "archived": true, "released": true, "releaseDate": "2012-02-26" }, { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-02-21T19:01:33.000+0000", "created": "2012-02-06T17:08:10.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "qe-port", "stage2" ], "versions": [ { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" } ], "issuelinks": [], "assignee": { "name": "bhughes", "key": "bhughes", "displayName": "Bryan Hughes", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-08-16T11:29:19.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": "11500", "name": "MobileWeb", "description": "Mobile Web (HTML) Platform" } ], "description": "A ScrollView with a child container View gets confused about its visible width.\r\n\r\nTo reproduce, run the following code in MobileWeb. The leftmost (red) View is truncated as shown in screenCaptures.\r\n\r\n{code:title=app.js}\r\nvar win = Ti.UI.createWindow({backgroundColor:'#ccc'});\r\nvar scroller = Ti.UI.createScrollView({\r\n\tbackgroundColor : '#fff',\r\n\tborderColor : '#333',\r\n\ttop : 40,\r\n\twidth : 500,\r\n\theight : 200,\r\n\tcontentWidth : 'auto',\r\n\tscrollType : 'horizontal'\r\n});\r\nvar container = Ti.UI.createView({\r\n\tlayout : 'horizontal',\r\n\twidth : 'auto', // or 800\r\n\theight : 'auto'\r\n});\r\nvar redView = Ti.UI.createView({backgroundColor:'#e66', height:150, width:200});\r\nvar greenView = Ti.UI.createView({backgroundColor:'#6e6', height:150, width:200});\r\nvar blueView = Ti.UI.createView({backgroundColor:'#66e', height:150, width:200});\r\nvar pinkView = Ti.UI.createView({backgroundColor:'#e6e', height:150, width:200});\r\n\r\nwin.add(scroller);\r\nscroller.add(container);\r\ncontainer.add(redView);\r\ncontainer.add(greenView);\r\ncontainer.add(blueView);\r\ncontainer.add(pinkView);\r\n\r\nwin.open();\r\n{code} ", "attachment": [ { "id": "25635", "filename": "scrollView_iOS.tiff", "author": { "name": "pseda", "key": "pseda", "displayName": "Patrick Seda", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-06T17:08:10.000+0000", "size": 5916, "mimeType": "image/tiff" }, { "id": "25634", "filename": "scrollView_mobileWeb.tiff", "author": { "name": "pseda", "key": "pseda", "displayName": "Patrick Seda", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-06T17:08:10.000+0000", "size": 6078, "mimeType": "image/tiff" } ], "flagged": false, "summary": "MobileWeb: ScrollView confused about its content width", "creator": { "name": "pseda", "key": "pseda", "displayName": "Patrick Seda", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "pseda", "key": "pseda", "displayName": "Patrick Seda", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "182159", "author": { "name": "bhughes", "key": "bhughes", "displayName": "Bryan Hughes", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This is a very interesting case. I'm actually not certain that our behavior is incorrect. What is happening is that you declared a container view and didn't assign it a left/top/right/bottom/center value. This causes it to default to a center of \"50%,50%\". The behavior of the layout algorithm is that if you do a percent based parameter inside of auto, it goes up the chain until it finds a non-auto width/height value. In this case, that non-auto value is the scrollview. This causes the center of the container to be pegged to the center of the scrollview, exactly as you are seeing above.\r\n\r\nThe proper solution is for you to define a left value of 0 on the container to position it where you want to (or not use a container at all, it's not really necessary). I'll leave this open for now though because it is a parity issue.", "updateAuthor": { "name": "bhughes", "key": "bhughes", "displayName": "Bryan Hughes", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-06T17:32:28.000+0000", "updated": "2012-02-06T17:32:28.000+0000" }, { "id": "183897", "author": { "name": "bhughes", "key": "bhughes", "displayName": "Bryan Hughes", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Pull Request: https://github.com/appcelerator/titanium_mobile/pull/1476", "updateAuthor": { "name": "bhughes", "key": "bhughes", "displayName": "Bryan Hughes", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-21T17:35:43.000+0000", "updated": "2012-02-21T17:35:43.000+0000" }, { "id": "183898", "author": { "name": "bhughes", "key": "bhughes", "displayName": "Bryan Hughes", "active": true, "timeZone": "America/Los_Angeles" }, "body": "To solve this elegantly, I added a new type of layout specific for mobile web called \"UncenteredAbsolute\" that ScrollView now defaults to. This way, the absolute layout remains universal, but we still get the proper behavior in scroll view.", "updateAuthor": { "name": "bhughes", "key": "bhughes", "displayName": "Bryan Hughes", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-21T17:36:55.000+0000", "updated": "2012-02-21T17:36:55.000+0000" }, { "id": "214809", "author": { "name": "lokeshchdhry", "key": "lokeshchdhry", "displayName": "Lokesh Choudhary", "active": false, "timeZone": "America/Los_Angeles" }, "body": "\r\nVerified fix on:\r\nTitanium studio : 2.1.1.201207271312\r\nSDK version : 2.2.0.v20120816015712\r\nAndroid 4.0.4 - default ,chrome 18.0 , firefox 14.0.1\r\nIphone 5.1.1 - safari mobile\r\nMountain lion(10.8) - chrome 21.0,safari 6,firefox 14.0.1\r\nWin 7 - IE 9", "updateAuthor": { "name": "lokeshchdhry", "key": "lokeshchdhry", "displayName": "Lokesh Choudhary", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-08-16T11:29:19.000+0000", "updated": "2012-08-16T11:29:19.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }