{ "id": "102620", "key": "TIMOB-11254", "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": "14826", "description": "Release 5.1.0-remaining iOS9 features, Android M features", "name": "Release 5.1.0", "archived": false, "released": true, "releaseDate": "2015-11-20" } ], "resolution": { "id": "11", "description": "Is not a bug in our product", "name": "Not Our Bug" }, "resolutiondate": "2013-07-19T23:03:46.000+0000", "created": "2012-10-03T22:42:03.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "parity" ], "versions": [ { "id": "14096", "description": "Release 2.1.2", "name": "Release 2.1.2", "archived": true, "released": true, "releaseDate": "2012-08-31" } ], "issuelinks": [], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2015-10-14T21:29:40.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" } ], "description": "When resizing a view with an animation, a centered child label will jump to its new position immediately rather than sliding along with the redraw Animation. This happens when animating to a different height (i.e. when the label should be vertically centered in the view) and when animating to a different width in case the label is set to textAlign: Ti.UI.TEXT_ALIGNMENT_CENTER (i.e. when the label should be horizontally centered in the view). This works perfectly fine on Android.\r\n\r\nh4.Steps to reproduce\r\n\r\n1. Create a default master / detail application and use the following detail function (ui/common/DetailView).\r\n\r\nExpected Behavior: label should slide along with the animation\r\n\r\nActual behavior: label just jumps off to the new position.\r\n\r\n{code}\r\nfunction DetailView() {\r\nvar self = Ti.UI.createView();\r\n\r\nvar wrapper = Ti.UI.createView({\r\n left: 10,\r\n top: 10,\r\n width: 200,\r\n backgroundColor: \"#CCC\",\r\n height: 50\r\n});\r\nvar label = Ti.UI.createLabel({\r\n left: 10,\r\n right: 10,\r\n text: \"Some text\",\r\n textAlign: Ti.UI.TEXT_ALIGNMENT_CENTER\r\n});\r\nwrapper.add(label);\r\nself.add(wrapper);\r\n\r\nvar isLarge = false;\r\nwrapper.addEventListener(\"click\", function(e) {\r\n isLarge = !isLarge;\r\n wrapper.animate({\r\n width: isLarge ? 300 : 200,\r\n height: isLarge ? 100 : 50,\r\n duration: 1000\r\n });\r\n});\r\nreturn self;\r\n}\r\nmodule.exports = DetailView;\r\n\r\n\r\n\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: When resizing a view, a centered child label does not go along with the animation", "creator": { "name": "aakkinepally", "key": "aakkinepally", "displayName": "Amuktha Akkinepally", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "aakkinepally", "key": "aakkinepally", "displayName": "Amuktha Akkinepally", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Ti SDK 2.1.1 GA, 2.1.2 GA, iOS 5, iOS 6", "comment": { "comments": [ { "id": "262536", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "ok not our bug. Look like the drawing operation of the label takes only the final rect into consideration. So although the frame of the label is animating correctly, it looks like it is jumping because the label has already drawn its text for final rect.\r\n\r\nDefine the label as shown below and you can see its frame animating correctly but the text drawing incorrectly (something we do not control).\r\n{code}\r\nvar label = Ti.UI.createLabel({\r\n left: 10,\r\n right: 10,\r\n text: \"Some text\",\r\n backgroundColor:'red'\r\n textAlign: Ti.UI.TEXT_ALIGNMENT_CENTER //This is the reason the text jumps\r\n});\r\n{code}\r\n\r\nTo work around this for this particular example, you can do something as shown below\r\n{code}\r\nvar labelWrapper = Ti.UI.createView({\r\n left: 10,\r\n right: 10,\r\n backgroundColor:'red',\r\n height:Ti.UI.SIZE\r\n});\r\n\r\n//Use a SIZED label\r\nvar label = Ti.UI.createLabel({\r\n text: \"Some text\"\r\n});\r\nlabelWrapper.add(label);\r\nwrapper.add(labelWrapper);\r\n{code}\r\n\r\nGoing to mark this as Not Our Bug", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-07-19T23:00:20.000+0000", "updated": "2013-07-19T23:04:05.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }