Problem
My app consists of a couple of "complex" views (contains many nested views). When the app is starting I can actually see how all of those elements are being put in place, and it's not very beautiful. I want to make sure that the content is finished rendering before i show it to the user. Kind of like the ready event works like in jQuery.
Implementation
Right now the app work as 1. Show activity indicator 2. Load data from server or local DB 3. Bind data to view 4. Hide activity indicator
However, sometimes the view hasn't finished rendering before the data is loaded and bound to the view. On slow devices, it can look really ugly for a couple of seconds.
Solution
I want to detect when the view has finished rendering. Then, I can wait by showing it until it's all finished. I imagine that I would have to listen to some kind of event to detect this, but i haven't found anyone that's been working.
What I've tried
I tried listening for the postlayout event. I tried attaching it to both the window and one of the parent views that's containing complex layout. It never get's fired. This I tried on iOS (7.1 and 8). Ultimately, a solution that works on iOS as well as Android would be optimal.
Versions
Titanium SDK: 3.4.0.GA iOS: 7.1 / 8.0 Android: 4.0+
Do you have any idea of how to accomplish this?