Search Unity

How do I add items to the ListView?

Discussion in 'UI Toolkit' started by tomicz, Mar 16, 2021.

  1. tomicz

    tomicz

    Joined:
    Mar 16, 2015
    Posts:
    152
    Hello there,

    Do I add it through a script or I can add it visually? I prefer it to add a dummy list item to see how it's going to look then dynamically expand it with code.
     
  2. manuelgoellnitz

    manuelgoellnitz

    Joined:
    Feb 15, 2017
    Posts:
    397
    Just with listView.Add(myelement);
     
    tomicz likes this.
  3. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    699
    Currently you have to add it through code, like manuelgoellnitz said, but we are aware of users wanting to visualize their list items in the UI Builder and have it down on our list of things to handle, just can't get to it right now!
     
    tomicz likes this.
  4. tomicz

    tomicz

    Joined:
    Mar 16, 2015
    Posts:
    152
    It's great to know. Xcode has a great solution for this, it will only show a single cell, you don't need to see an entire list. That would be a great idea.