{ "id": "64144", "key": "TIMOB-3512", "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": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-05-30T14:50:15.000+0000", "created": "2011-04-15T03:46:07.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "core", "module_window", "qe-testadded" ], "versions": [], "issuelinks": [ { "id": "17514", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "92294", "key": "TIMOB-9226", "fields": { "summary": "Android: Review composite layout feature requests", "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": "High", "id": "2" }, "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } } ], "assignee": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-07-13T12:22:42.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": "{html}

Tested using Titanium SDK 1.6.1 (15 Mar 2011), Android emulator\n2.2

\n

When a window is opened with a vertical layout, and labels (or\npresumably any view or widget, although this has not been\nexplicitly tested) are added to it, they are displayed in the\nincorrect order. The following code demonstrates the issue:

\n
\nvar win1 = Ti.UI.createWindow({\n  title: \"Main Window\",\n  exitOnClose: true,\n  layout: 'vertical',\n  navBarHidden: false\n});     \n \nvar btnNewWin = Ti.UI.createButton({\n  top:5,\n  width:301,\n  height:57,\n  title: \"New Win\"\n});\nwin1.add(btnNewWin);\nwin1.open();\n \nbtnNewWin.addEventListener('click', function() {\n  var win2 = Ti.UI.createWindow({\n    title: \"Second Window\",\n    layout: 'vertical',\n    navBarHidden: false\n  });    \n  win2.open();\n  \n  for(var i=0; i < 10; i++) {\n    var lbl = Ti.UI.createLabel({\n        text: 'Label: ' + i,\n        textAlign:'left'\n    });\n    win2.add(lbl);\n  }\n//  win2.open(); // moving open() to here resolves the issue\n});\n
\n

Note that opening the window after the labels have been\nadded works around the issue.

\n

Using the code above, the labels are laid out in the incorrect\norder:
\n\n\"before\"

\n

After the workaround is used, labels are correctly\ndisplayed:
\n\n\"after\"

{html}", "attachment": [], "flagged": false, "summary": "Android: vertical layout incorrect order when window opened before adding children", "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": "196589", "author": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Cannot reproduce with 2.1.0 master builds (05/30/12).", "updateAuthor": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-05-30T14:47:05.000+0000", "updated": "2012-05-30T14:47:05.000+0000" }, { "id": "196591", "author": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Fixed as part of composite layout enhancements.", "updateAuthor": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-05-30T14:50:15.000+0000", "updated": "2012-05-30T14:50:15.000+0000" }, { "id": "200407", "author": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fix with\r\n\r\nTitanium Studio, build: 2.1.0.201206251749\r\nTitanium SDK: 2.1.0.v20120626104306\r\nDevice:\r\nLG VS910 4G\r\nAndroid version 2.3.6\r\n", "updateAuthor": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-26T15:04:34.000+0000", "updated": "2012-06-26T15:04:34.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }