I have added a dropdownfield to my uxml file in UI Builder, but I can not change the styling of the dropdown items, checkmark etc. A stylesheet is added to the uxml and I am overriding the base classes .unity-base-dropdown__checkmark (and others) inside that as well, but it doesn’t show in the final result (Game View and Simulator).
These dropdown items get instantiated inside their own container (when viewing the hierarchy inside UI Toolkit Debugger) and thus don’t have the stylsheet from inside the uxml file applied by default. How do I add this stylesheet to these items?
It’s not very easy, I used the solution that was suggested here DropDownField popup height in runtime - how to limit? . Maybe there is a different way already…
Thanks for the link, I will look at it. What a mess and total hack if that works…
@ChGuidi your path still works, though the interface now collides with the one built into Unity, so that needs to be removed (otherwise everything works). But I still was not able to change the stylesheets of the dropdown that gets instantiated.
Upon further investigation I stumbled upon the UnityDefaultRuntimeTheme tss file that, after adding my own stylesheet to its list, changed the dropdown to my liking. See here for what lead me to it: Intended use of Theme Style Sheet