Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question UIBuilder Dropdown Backgroundcolor not changeable

Discussion in 'UI Toolkit' started by DCK2022, Apr 25, 2023.

  1. DCK2022

    DCK2022

    Joined:
    Dec 25, 2022
    Posts:
    4
    I'm lost with the dropdown field in the uibuilder.
    Seems there is no way to change the whole color of this element which makes it absolutely senseless.
    Only the color of the labelpart changes but the itempart always stays in ugly gray.

    I saw some hint regarding panels and uss styling attempts. But I have not idea where I can access this uss file for the item-part of the dropdown field.
    Also nowhere is a concrete tutorial how this must be done.

    Somebody has a hint for me?


    Besides,
     
  2. SimonDufour

    SimonDufour

    Unity Technologies

    Joined:
    Jun 30, 2020
    Posts:
    529
    Hi! To be above everything else in the panel, the dropdown is the last element of the panel, at the root. And stylesheet added to an element only applies to the descendant of the element. If you add a stylesheet with your dropdown styles on the root visual element of the panel, it will work. Use the UI debugger to inspect the hierarchy and verify that they are applied. There are probably some other post on the forums on this, as you are not the only one with this ... surprise.
     
  3. DCK2022

    DCK2022

    Joined:
    Dec 25, 2022
    Posts:
    4
    Thanks for the hint. I'm still trying, but this dropdown box is not reacting on any kind of stylesheet.
    All this tutorials I followed seem to be straight forward, but it's all not working.
    Someone has a working example?