The problem
TiWindow fires "postlayout" event twice. To see that issue, run this example:
var win = Ti.UI.createWindow({
backgroundColor: '#ccc'
});
var table = Ti.UI.createTableView();
win.add(table);
var data = [];
for(var i = 0; i < 500; i++){
data.push({ title:'Row #'+i });
}
table.setData(data);
win.addEventListener('postlayout', function() {
Ti.API.info('Postlayout event fired!');
});
win.open();
In console output, you should see two infos, meaning event gets fired twice.
Expected result
"postlayout" event should be fired only once.
The problem reproduces with release 3.0.2 and master release 3.1.0 tested on Titanium Studio, build: 3.0.2.201302191606 Titanium SDK version: 3.1.0 Titanium SDK version: 3.0.2 Device: Samsung galaxy s duos Android version: 4.0.4 Android Emulator: Android SDK version: 2.2
'postlayout' is fired whenever a layout is done and there are many cases where a layout will required. 'postlayout' is not a one time event, it could be fired multiple times.
Closing as invalid. If incorrect, please reopen.