{ "id": "63714", "key": "TIMOB-3082", "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": "11242", "name": "Release 1.6.0 M09", "archived": true, "released": true, "releaseDate": "2011-02-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T02:00:52.000+0000", "created": "2011-04-15T03:36:27.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [ "android", "defect", "regression", "release-1.6.0", "reported-1.6.0" ], "versions": [], "issuelinks": [], "assignee": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2011-04-17T02:00:52.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}
Generally speaking: if a heavyweight window's\nlayout property is set to vertical via\nits proxy after the window is already open, things added\nto the window after that don't respect the vertical layout.
The KitchenSink vertical layout test is a good example: the\nheader doesn't show.
\nBut here's a simpler app.js failcase:
\n\nTitanium.UI.setBackgroundColor('#000');\n\nvar win = Titanium.UI.createWindow({ \n backgroundColor:'#000',\n exitOnClose: true,\n fullscreen: true,\n navBarHidden: true\n});\n\nwin.open();\n\nwin.layout = 'vertical';\n\nfor (var i = 0; i < 10; i++) {\n win.add( Ti.UI.createLabel({ text: 'Label ' + i, height: 40 }) );\n}\n\nThe labels added there near the end will all stack up on each\nother in the middle of the window.
The reason this happens is that when
\nwin.layout = 'vertical';
occurs in the code above, the view (TiUIWindow) has not yet been\nset as a model listener on the window proxy. So though KrollProxy\nfires a property change when layout gets set,\nTiUIWindow doesn't know about it and doesn't set its layout\naccordingly (the propertyChanged code in TiUIWindow\ndoesn't run.)
setModelListener gets called when the new activity\nsends the MSG_ACTIVITY_CREATED message back to\nTiUIWindow (see TiUIWindow's handleMessage). For\nreasons I don't understand, that doesn't happen until all these\nviews (in the for loop in my code sample above) have\nalready been created and added to the window.
I misspoke in the previous comment. The\nMSG_ACTIVITY_CREATED handling in TiUIWindow occurs\nbefore views get added to the window. But layout was\nnot being handled in processProperties (which runs\nwhen setModelListener is set). When he handle it in\nprocessProperties, everything works fine.
(from [bd9d12403051a464ec102f46aac9c4420a45a7e6])\n[#3082 state:fixed-in-qa] Add 'layout' to one of\nthe properties checked and handled in TiUIWindow processProperties\n\nhttps://github.com/appcelerator/titanium_mobile/commit/bd9d12403051...
[INFO] Titanium SDK version: 1.6.0 (02/08/11\n20:55 bd9d124...) galaxy tab (2.2.2) G1 (1.6) Nexus S (2.3) sim\n2.1