{ "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
\nWhen 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
\nNote that opening the window after the labels have been\nadded works around the issue.
\nUsing the code above, the labels are laid out in the incorrect\norder:
\n
After the workaround is used, labels are correctly\ndisplayed:
\n