[TIMOB-10005] iOS: "postlayout" event doesn't work as it should
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-12-21T05:26:41.000+0000 |
Affected Version/s | Release 3.0.0 |
Fix Version/s | Sprint 2012-15 Core, Release 3.0.0 |
Components | iOS |
Labels | core, layout, module_window, qe-review, qe-testadded |
Reporter | Ivan Skugor |
Assignee | Neeraj Gupta |
Created | 2012-07-04T00:13:59.000+0000 |
Updated | 2013-12-02T09:14:53.000+0000 |
Note that this is not iOS only issue. Android also has issue with "postlayout" event, but it is different (maybe another ticket should be filed for that).
Sorry, I missed to notice that other "Android" ticket. It is incomplete, as you can see in this ticket, "postlayout" event is not fired for TiButton and TiLabel.
We cannot fire only a single "postlayout" event in all situations because the multiple layout passes are required and we cannot determine which one is the final event without looking into the future. Instead the number of postlayout events can be reduced, so they are only fired when the view's size actually changes.
It would be nice if situations when events are fired multiple times are documented. Thanks.
PR https://github.com/appcelerator/titanium_mobile/pull/2632 merged against master. As noted in the comments the postLayout event is only fired if either the size or position of the view changes. Also the event no longer propagates to the parent.
Verified fix with: Titanium Studio, build: 2.1.1.201207271312 Titanium SDK: 2.2.0.v20120813184911 Devices: iPhone 4s 5.0.1 iPad1 5.1.1 Simulator 5.1
Reopening to update labels