{ "id": "84924", "key": "TIMOB-7203", "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": "2012-01-17T08:38:36.000+0000", "created": "2012-01-16T09:39:38.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "parity" ], "versions": [ { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" } ], "issuelinks": [ { "id": "14582", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "84105", "key": "TIDOC-74", "fields": { "summary": "APIDOC: UI view size property should be documented as the rendered view size and as read-only", "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": "Low", "id": "4" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-09T23:14:28.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" } ], "attachment": [], "flagged": false, "summary": "iOS: UI.View - make size property read-only", "creator": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "subtasks": [], "reporter": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "environment": "* Titanium Mobile 1.8.0.1\r\n* iOS5\r\n", "comment": { "comments": [ { "id": "179457", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "The above test case proves that the size property is read-only. Closing as invalid.", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2012-01-16T14:30:40.000+0000", "updated": "2012-01-16T14:30:40.000+0000" }, { "id": "179460", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Note that the behavior is the same for Android, although there are bugs presently that mean that size is not correct unless the window is heavyweight, view is already rendered, used within an window open event and the first open event is ignored, as per the following code:\r\n\r\n{code:lang=javascript|title=app.js}\r\nvar win = Ti.UI.createWindow({\r\n fullscreen:false,\r\n backgroundColor:'red'\r\n});\r\n\r\nvar view = Ti.UI.createView({\r\n backgroundColor:'blue',\r\n width:50,\r\n height:50\r\n});\r\n\r\nwin.add(view);\r\nwin.open();\r\n\r\nvar openEventCount = 0;\r\n\r\nwin.addEventListener('open', function() {\r\n openEventCount++;\r\n Ti.API.info(\"------- Window event fired: open --------\");\r\n if(openEventCount === 2){\r\n Ti.API.info(\"*** Before width changes 50 ***\");\r\n Ti.API.info(\"view.size w x h: \" + view.size.width + \" x \" + view.size.height);\r\n Ti.API.info(\"view w x h: \" + view.width + \" x \" + view.height);\r\n\r\n Ti.API.info(\"*** view.size.width change 100 ***\");\r\n view.size.width = 100; // this should NOT work\r\n Ti.API.info(\"view.size w x h: \" + view.size.width + \" x \" + view.size.height);\r\n Ti.API.info(\"view w x h: \" + view.width + \" x \" + view.height);\r\n\r\n Ti.API.info(\"*** view.width change 200 ***\");\r\n view.width = 200; // this should work\r\n Ti.API.info(\"view.size w x h: \" + view.size.width + \" x \" + view.size.height);\r\n Ti.API.info(\"view w x h: \" + view.width + \" x \" + view.height);\r\n }\r\n});\r\n{code}\r\n\r\n{code:lang=none}\r\nD/AndroidRuntime( 1308): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<\r\nI/TiApplication( 1309): (main) [321,321] Titanium 1.8.0.1 (2011/12/22 13:09 fbdc96f)\r\nI/TiApplication( 1309): (main) [8,656] Titanium Javascript runtime: v8\r\nD/TiAssetHelper( 1309): Fetching \"app.js\" with Fastdev...\r\nI/TiAPI ( 1309): ------- Window event fired: open --------\r\nI/TiAPI ( 1309): ------- Window event fired: open --------\r\nI/TiAPI ( 1309): *** Before width changes 50 ***\r\nI/TiAPI ( 1309): view.size w x h: 50 x 50\r\nI/TiAPI ( 1309): view w x h: 50 x 50\r\nI/TiAPI ( 1309): *** view.size.width change 100 ***\r\nI/TiAPI ( 1309): view.size w x h: 50 x 50\r\nI/TiAPI ( 1309): view w x h: 50 x 50\r\nI/TiAPI ( 1309): *** view.width change 200 ***\r\nI/TiAPI ( 1309): view.size w x h: 50 x 50\r\nI/TiAPI ( 1309): view w x h: 200 x 50\r\n{code}", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2012-01-16T14:40:36.000+0000", "updated": "2012-01-16T14:40:36.000+0000" }, { "id": "179554", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "In case a race condition is involved, I wrapped a setTimeout around the logging lines, and confirmed view.size.width value is read-only. Hence, closing.", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2012-01-17T08:37:36.000+0000", "updated": "2012-01-17T08:37:36.000+0000" }, { "id": "410953", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-09T23:14:28.000+0000", "updated": "2017-03-09T23:14:28.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }