Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: wallabie on May 19, 2014, 10:58:11 AM
-
Use case:
ScrollView is dynamically populated, after it's populated, I need a toggle a particular item to be highlighted. Is there an event that's fired when the Scrollview has finished populating itself.
-
Scroll view doesn't populate itself. You are the one who populates it, so I am not sure what you mean?
-
Yes, I realize that I am populating it myself. Then after it's populated, I'm calling Reposition() and ResetPosition(). These methods take time to do the layout. I don't want to mention anymore names of other GUI competitors, but usually there is a event that one can subscribe to let us know when all of the layout work has been completed.
In this use case, I need to highlight one of the items in the scrollView after everything has been laid out. The hack I'm using now is to call a coRoutine to wait for some time interval after the call to Reposition(). It's much better for the ScrollView to let us know when it has done its work.
-
They don't take "time" as such, they take a frame, since the Panel has to create the UIDrawCall that actually draws it on screen.
As soon as you've done your "PopulateMethod();" you should be able to do what you need to do following.
You can also force the UIPanel to refresh by calling its Refresh method or BroadcastMessage("CreatePanel") on it.
-
Thanks for the info.