cocos2dx in cocos2d :: ui :: ListView pit

ListView can be automatically formatted, thus using up more effort. But there is a place to note:
If you want to delete the elements, can not call removeFromParent elements, but need to call ListView :: removeChild ()

why? Because after elements into the ListView, essentially becoming child ListView inside innerContainer at this time if removeFromPrarent elements call, only the call removeChild innnerContainer, there is no call ListView rewritten version. Rewrite version contains some important logic code, not to call.

Consequence is that, after deleting elements, ListView size does not change accordingly, if you frequently add or delete elements, see ListView kept longer.

Guess you like

Origin www.cnblogs.com/eaglelun/p/11225413.html