Today, there is a problem, for Uilistview, after initialization (Pushbackcustomitem), if you do it immediately, because the original is not re-layout, it can cause some weird problems. After viewing the code, it is found that dolayout and forcedolayout can be re-laid, and the caller is the visit function.
Thus, after initializing the ListView, immediately using the visit, and then the ListView operation, there will be no problem. One thing to note, however, is that when OnEnter, visit is also called, that is, in fact visit more than once. If the first visit and the second visit get the same result, that is the correct result, then there is no problem. Otherwise, after manual visit, you get the wrong result, it is useless to call this visit manually. Another problem is that, after visit, there's nothing wrong with syncing. If the delay operation, if the ListView before the end of the items are changed, it will be re-dolayout, some parameters will change, then the delay operation will deviate from the original setting, there is a problem.
If visit is not available, you must provide a callback after the full load (that is, visit) is notified that the next step can be made, otherwise it is not possible to do something like this after loading the recalculation. Then there is no such callback, so you can only use visit.
This article from "Mountain Heavy Water Complex" blog, declined reprint!
Analysis of timing problems in COCOS2DX