Analysis of timing problems in COCOS2DX

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.