Search Unity

Question ListView: How to remove focus from top element

Discussion in 'UI Toolkit' started by silviu-georgian77, Oct 6, 2021.

  1. silviu-georgian77

    silviu-georgian77

    Joined:
    Jan 17, 2016
    Posts:
    12
    Hello

    I am creating a simple ListView and all I want is to get rid of that grey selection area.
    Steps to reproduce:
    1. Create a ListView
    2. Fill it with elements via code
    3. Just scroll. No matter what options you have selected for the ListView, it displays that grey background for the top element.

    I imagine this is a bug, but couldn't it be fixed with some CSS for the moment?
    I don't know how to refer to that particular background (in CSS or C#) in order to deactivate it.

    Also,
    Code (CSharp):
    1.  private void BindItem(VisualElement e, int index)
    2.     {
    3.         CustomizedTeam customizedTeam = customizedTeams[index];
    4.  
    5.         e.Q<Label>().text = customizedTeam.name;
    6.  
    7.         e.RegisterCallback<ClickEvent>(TeamItem_clicked);
    8.     }
    Registering clicks doesn't work like I wrote it. Any hints.
     

    Attached Files:

  2. silviu-georgian77

    silviu-georgian77

    Joined:
    Jan 17, 2016
    Posts:
    12
    Update: Decided not to use the UI Builder anymore.

    Please change the version number to something like 0.2
    1.0.0-Preview is very misleading, I thought it is almost ready, but in fact mostly nothing works.