The List Item control is essentially like a button control that serves as an item in a
Scroll List control except that it "selectable" and will remain in the active state when selected, much like a radio button. The containing scroll list will track which list item control is the currently selected item. One common use of List Items is to store them in prefab form and then either add them to a list's Prefab Items array, or instantiate them at runtime from code to populate a
Scroll List. There are two main approaches you can take to using a List Item:
- Create a separate list item with a unique texture for each item you wish to display, or
- Use a single base List Item and then represent different options by different text on each item instance.
NOTE: If you want to nest multiple sub-controls, sprites, or text inside your list item, it is recommended instead to use a
UIListItemContainer which is capable of clipping sub-controls to the viewable area of the scroll list. In such a case, to reproduce the radio-button like functionality of a
UIListItem, use radio button controls inside your
UIListItemContainer objects, then uncheck their "
Use Parent For Grouping" option, then set the
Radio Group setting to the same value for all radio buttons which are to be mutually exclusive with one another.