{ "id": "63995", "key": "TIMOB-3363", "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": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2012-03-05T11:24:07.000+0000", "created": "2011-04-15T03:43:18.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [], "issuelinks": [ { "id": "15530", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "outwardIssue": { "id": "81779", "key": "TIMOB-5819", "fields": { "summary": "Android: Percentage-based views need to be re-drawn on device rotation", "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": "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": "2017-03-20T22:07:24.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": "Note that although the title mentions widths and views, other dimensions and UI objects have not been tested. Thus, this issue _may_ extend to any UI object and any dimensions where percentages are used.\r\n\r\nBehavior exhibited using:\r\n* emulator\r\nAndroid 2.2\r\nTi 1.6.0 and 1.6.1\r\n\r\nAlso tested on Samsung Galaxy S running 2.2.1, with same results.\r\n\r\nWith the following code (which will work in app.js without modification), although the percentage width of the view (set at a value of 90%) initially seems to work, if the orientation is toggled a couple of times, the width is changed to 90% of the _other_ orientation. In other words, when the orientation is portrait, the view is set to 90% of the landscape view, and vice versa.\r\n\r\n\r\n{code}\r\nvar win1 = Ti.UI.createWindow({\r\n backgroundColor:\"white\",\r\n title:'win1'\r\n});\r\nvar view = Ti.UI.createView({\r\n backgroundColor: \"green\",\r\n height:50,\r\n width:\"90%\",\r\n top:100\r\n});\r\n\r\nwin1.add(view);\r\n\r\nwin1.open();\r\n{code}\r\n\r\nWhen the above bug has been resolved, please also check that it works for tabgroups, as per [http://developer.appcelerator.com/question/117316/percentage-width-still-doesnt-work]\r\n\r\nThe following code can be used to test this scenario:\r\n\r\n{code}\r\nvar tabGroup = Ti.UI.createTabGroup();\r\n \r\nvar win1 = Ti.UI.createWindow({\r\n title:'win1'\r\n});\r\n \r\nvar tab1 = Ti.UI.createTab({ \r\n title:'tab1',\r\n window:win1\r\n});\r\n \r\nvar label1 = Ti.UI.createLabel({\r\n text:'tab1'\r\n});\r\n \r\nwin1.add(label1);\r\n \r\n \r\nvar win2 = Ti.UI.createWindow({\r\n title:'win2'\r\n});\r\n \r\nvar tab2 = Ti.UI.createTab({ \r\n title:'tab2',\r\n window:win2\r\n});\r\n \r\nvar view = Ti.UI.createView({\r\n backgroundColor: \"green\",\r\n height:50,\r\n width:\"90%\",\r\n top:100\r\n});\r\n\r\nwin2.add(view);\r\n\r\ntabGroup.addTab(tab1); \r\ntabGroup.addTab(tab2); \r\n \r\ntabGroup.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "Percentage width of views not respected", "creator": { "name": "hal", "key": "hal", "displayName": "hal", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "environment": null, "comment": { "comments": [ { "id": "130614", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Added several of you for notifications to make sure we have\ntests for this.

{html}", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:43:18.000+0000", "updated": "2011-04-15T03:43:18.000+0000" }, { "id": "133777", "author": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Hi.\n\nIf I may add one more issue related to the calculation of dimensions when defined as percentages:\n\nhttp://developer.appcelerator.com/question/116905/percentage-dimensions-in-nested-views", "updateAuthor": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2011-05-16T23:57:36.000+0000", "updated": "2011-05-16T23:57:51.000+0000" }, { "id": "414046", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as duplicate.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-20T22:07:24.000+0000", "updated": "2017-03-20T22:07:24.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }