{ "id": "171241", "key": "TIMOB-25838", "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": null, "resolutiondate": null, "created": "2018-03-06T02:30:57.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "defaultunit", "engSchedule", "ios", "layout", "percent" ], "versions": [ { "id": "19906", "description": "", "name": "Release 6.3.0", "archived": false, "released": true, "releaseDate": "2017-11-01" }, { "id": "19882", "name": "Release 8.0.0", "archived": false, "released": true, "releaseDate": "2019-03-14" } ], "issuelinks": [], "assignee": null, "updated": "2019-04-16T16:16:10.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "*Summary:*\r\nWhen setting the \"tiapp.xml\" property \"ti.ui.defaultunit\" to a unit other than \"dp\", layouts \"vertical\" and \"horizontal\" will miscalculate percentage based \"width\" and \"height\" properties.\r\n\r\n*Steps to Reproduce:*\r\n# Modify project's \"tiapp.xml\" with the below \"ti.ui.defaultunit\" property. (Sets it to pixels.)\r\n# Build and run the below JavaScript on an iOS device.\r\n# Observe the size of the gray rectangle. It's supposed to be 50% wide and 50% tall.\r\n\r\n{code:xml}\r\n\r\n\r\n\tpx\r\n\r\n{code}\r\n\r\n{code:javascript}\r\nvar window = Ti.UI.createWindow(\r\n{\r\n\tlayout: \"vertical\",\r\n//\tlayout: \"horizontal\",\r\n});\r\nwindow.add(Ti.UI.createView(\r\n{\r\n\tbackgroundColor: \"gray\",\r\n\tborderColor: \"black\",\r\n\tborderWidth: \"1dp\",\r\n\ttop: \"25%\",\r\n\tleft: \"25%\",\r\n\twidth: \"50%\",\r\n\theight: \"50%\",\r\n}));\r\nwindow.open();\r\n{code}\r\n\r\n*Result:*\r\nLooks like attached \"Screenshot-Bad.png\" where the gray rectangle is *NOT* centered onscreen, with a 50% width and 50% height.\r\n\r\n*Expected Result:*\r\nShould look like attached \"Screenshot-Good.png\".\r\n\r\n*Notes:*\r\n* This bug does not occur if \"ti.ui.defaultunit\" is set to \"dp\".\r\n* This bug does not occur with \"composite\" layouts, which works with all units.\r\n* This is not an issue with percentage based \"top\", \"bottom\", \"left\", or \"right\" properties.\r\n* This is not an issue on Android.\r\n", "attachment": [ { "id": "64925", "filename": "Screenshot-Bad.png", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-03-06T02:28:23.000+0000", "size": 20057, "mimeType": "image/png" }, { "id": "64924", "filename": "Screenshot-Good.png", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-03-06T02:28:27.000+0000", "size": 20007, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS: Horizontal/Vertical layout miscalculates percent width/height when default unit is not \"dp\"", "creator": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [], "maxResults": 1, "total": 1, "startAt": 0 } } }