Changing size of dropdown in unity

Hey Guys ,
I am having troubles with setting up larger size of dropdown…

as you can see the standard size of dropdown is 160 x 30 so when you click on the dropdown arrow the 3 options below (A B and C) are same size as above and all have same font size …

But I need to use Larger size of dropdown, so when I increase the size of it to 320 x 60, and change the font size to 5O… the change does not affect the 3 options below , A B C still have original size of 160 x 30 and original font size which is now way too small …

how do I change this please thanks … I tried everything

I also noticed that some setting for those 3 dropped downs options don’t appear in inspector till you hit play

Thanks in advance

Beri

2 Likes

DropDown has a template in it. If you look at the object when you add it to the scene, it has children. Expand it and you’ll see the Template child.

Then go Template → Viewport → content ->Item → Item Label
Item Label is where you can change the size of your dropdown objects

3 Likes

2692088--190452--dropdown.jpg
To do this, i changed

  • Dropdown > Template > Viewport > Content : Height 50
  • Dropdown > Template > Viewport > Content > Item : Height 50,
  • Dropdown > Template > Viewport > Content > Item > Item Label : Font size 24, bold, italic, Vertical Overflow

(Actually Vertical Overflow should be set to Overflow on every Label in every UI… Why would they ever want to hide the text? There’s a separate mask for that.)

32 Likes

Thank you that worked but I don’t get as nice result as you do… even with your settings option A is a bit too high and option C is too close to the bottom almost getting out of the frame

Thanks. Zaflis.

Perfect solution. Thank you so much!

2 Likes

nice one. About to write similiar wuery on this. Thanks a lot…

Thank you! Very nice

Another one to look at:
Dropdown > Template : Height 400

3 Likes

Over 5 years old and still great advice!

Thanks Zafis. Unity 2021.1.16 and you are the only one saver

How would you do this in a script? I generate the members of the dropdown list in my script, so I need to also set these values in my script.

There shouldn’t be an issue accessing those object properties in script. At the top you should add:

using UnityEngine.UI;

One example:

listitem.GetComponent<Text>().text = "Hello world";

Other than that we might need to know more about the case. Digging deeper into sub-objects sometimes takes a little bit of effort… But even prefabs may be able to auto-fill some reference variables.

Thank you still 6 years later :slight_smile:

7 years!

You have probably figured out what the Problem was, but to anyone having the same issue:
Make sure, that both height values

  • Dropdown > Template > Viewport > Content : Height X
  • Dropdown > Template > Viewport > Content > Item : Height X

are set to the same value.

2 Likes