{ "id": "99079", "key": "TIMOB-10421", "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": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2017-06-15T17:41:46.000+0000", "created": "2012-08-13T10:56:12.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "core" ], "versions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "issuelinks": [], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-06-15T17:41:46.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": "h4. ScrollView - mobileweb vs iphone discrepancy\r\nWhen adding views to a ScrollView where contentWidth = Ti.UI.SIZE and contentHeight = Ti.Ui.SIZE,\r\nthe view is added to the top left indicating the contentView is the same size as the newly added view instead of \r\nfilling most space of the scrollview. This also occurs if contentWidth and contentHeight are left blank.\r\nThe reason this is an issue is because it acts differently than iOS on iPhone. On iPhone, the view will be centered in the scrollview.\r\nThe importance for using Ti.UI.SIZE is for the contentView to expand upon it's content so that it can scroll\r\nand not be a fixed view within the scrollview.\r\n\r\n\r\nh4. Steps to reproduce:\r\n1. Copy the code below into a new project\r\n2. Run on iPhone emulator\r\n Note the purple square in the center of the grey scrollview\r\n3. Run on mobileweb\r\n Note the purple square at the top left of the grey scrollview\r\n\r\nh4. CODE:\r\n{code}\r\nvar win1 = Titanium.UI.createWindow({\r\n backgroundColor:'#fff'\r\n});\r\nvar scrollview = Ti.UI.createScrollView({\r\n\tcontentWidth: Ti.UI.SIZE,\r\n\tcontentHeight: Ti.UI.SIZE,\r\n\twidth: 200,\r\n\theight: 300,\r\n\tbackgroundColor: '#444'\r\n});\r\nvar view = Ti.UI.createView({\r\n\twidth: 20,\r\n\theight: 20,\r\n\tbackgroundColor: '#F0F',\r\n});\r\n//Workaround\r\n// scrollview.contentWidth = scrollview.width;\r\n// scrollview.contentHeight = scrollview.height;\r\nscrollview.add(view);\r\nwin1.add(scrollview);\r\nwin1.open();\r\n{code}\r\n\r\nh4. Workaround\r\n1. Use the code above but uncomment the lines below '//Workaround'\r\nSets contentWidth to width of the scrollview\r\nSets contentHeight to height of the scrollview\r\nThis works as it should on iPhone", "attachment": [], "flagged": false, "summary": "MobileWeb: ScrollView - contentWidth and contentHeight act differently than iOS using Ti.UI.SIZE", "creator": { "name": "amiller", "key": "amiller", "displayName": "Alexander Miller", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "amiller", "key": "amiller", "displayName": "Alexander Miller", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Google Chrome version 21.0.1180.57\r\niOS iPhone 5.1\r\nTi SDK: 2.2.0.v2012723112115", "comment": { "comments": [ { "id": "422059", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket due to time passed and lack of progress in the past few years. Any problems, please file a new ticket.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-06-15T17:41:46.000+0000", "updated": "2017-06-15T17:41:46.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }