New UI Scrollview with changing content

Hello all,

I am looking for a good solution to populating a list of servers to connect to from a client. I want a scrollable list of buttons. Using the old UI, I could use a for loop to generate the buttons inside a scrollview. Is there anything similarly easy in the new UI system? I’m leaning toward using a panel as the scrollview content, dynamically resizing the panel’s height depending on the number of servers to connect to (= the number of buttons) and the resolution, and somehow dynamically creating the buttons. I’m not yet sure how anchoring figures into creating the buttons.

Is there a simple feature built into the new UI to achieve this task, or subsets of this task?

The layouts components will help. I’m in the process of building a YouTube tutorial to do just that. Will post back tonight when it’s up.

The basic strategy is to iterate over your collection and Instantiate a prefab for each button. Then set the parent to a panel that has a vertical layout group. You can adjust sizing of each button using a layout element.

Edit: As promised here is the link to a video