A dynamic scrolling list based on UGUI mainly supports the following functions:
-
Inherited from UGUI
SrollRect
, supports all functions ofScrollRect
; -
Use object pools to manage list elements to achieve reuse of list elements;
-
Supports multiple elements in one row or multiple elements in one column;
-
List elements of different sizes can be used;
-
Dynamically refresh the list elements after the list data changes;
For details on the usage of , please refer to the examples attached to the project, in the scenario Scene
and the script . Canvas1
TestScript
ScrollViewEx
When the number of items is huge, you can useScrollViewEx
.
ScrollViewEx
inherits all the functions of ScrollView
and carries out targeted optimization. It will paginate items and set the appropriate page size to get better performance. For details, see in SceneScene
, and Script. Canvas2
TestLargeAmount.cs
The following is used when there are 50,000 itemsScrollView
and ScrollViewEx
, and the page size is specified as 30:
Both take time when adding, deleting data or jumping randomly: