You don’t need code.
You need to go into the item template and adjust the anchoring and probably the parenting and then make your own inset button boundary.
Pay attention to what is connected to the DropDown inspector itself and make sure things are still correct so it can inject the text, clone the template, etc.
I did it like this, took about 3 or 4 minutes of fiddling. The only thing I added was the green item… see inspector closeup. I cloned the ItemBackground
and moved it to just “under” the ItemLabel
, then renamed it to ItemPerimeter
I highly recommend doing it a few times (do it, delete it, do it again, etc.) on a Dropdown you don’t care about until you’re a real pro.
Here’s more anchoring notes… it’s critical that you “get” how the anchoring works otherwise this will be endlessly infuriating to get right.
Here are the official docs on how to make your UI handle various resolutions and aspect ratios cleanly:
Here are some notes on UI Anchoring, Scaling, CanvasScaler, etc: