Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9816] Android: TiWindow fires "postlayout" event twice

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionInvalid
Resolution Date2014-02-08T04:23:42.000+0000
Affected Version/sRelease 2.1.0, Release 3.1.0
Fix Version/sBacklog
ComponentsAndroid
Labelscore, ipass1
ReporterIvan Skugor
AssigneeSunila
Created2012-06-27T01:32:46.000+0000
Updated2018-08-06T17:37:01.000+0000

Description

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.

Comments

  1. Shameer Jan 2013-03-20

    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
  2. Sunila 2014-02-08

    '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.
  3. Eric Merriman 2018-08-06

    Closing as invalid. If incorrect, please reopen.

JSON Source