ListView vs ScrolBox?

Imagine you have 200 widgets.

If you place widgets in a Scroll Box, all of them get instantiated, their assets loaded and it all sits in the memory. If you use a List View, only the necessary widgets will be created - on the fly. The List View will automagically maintain their lifecycle.

There’s a tangible example at the end of this post:

A combat log like this could easily grow to hold thousands of widget entries, but the likelihood of the user wanting to seem them all is pretty low. So it’s better to have a List View hold just the data, rather than have a Scroll Box keep it all alive at all times.


This tooltip:

image

is not really that accurate in my experience, more than 5 would be created and kept alive. I’d say around 10, but that’s much better than 200!


If you need to display just a handful of widgets, a Scroll Box will be more than fine. If you need to handle hundreds or thousands elements, consider paying the upfront cost of setting up a List View.

3 Likes