Search Unity

Dropdown menus with images

Discussion in 'UGUI & TextMesh Pro' started by skyser5, Mar 24, 2016.

  1. skyser5

    skyser5

    Joined:
    Jun 11, 2015
    Posts:
    24
    Hi all,

    I wanted to add images to dropdown menus, but I found the documentation confusing and could find no good working examples on the web.

    I've kind of got it working, so maybe this will save someone some pain.

    In order to get going you need to work on the Template object that dropdown gets created with. It's disabled by default, so you need to enable it to see it in scene view.

    You need to create two Images objects to serve as placeholders. Create the first one as a child of the Dropdown itself. Call it captionImage. Create a different image as a child of the Item object inside the Template object. Call this itemImage.

    At the toplevel of your dropdown find the slots these images go to and drag them in.

    NOTE: If you don't set up both images, it won't work and you won't get errors!

    Also, ran into trouble with images being too big for the item, so unless you are creating items from scratch, use small icons. capture.png
     
  2. paragyogi

    paragyogi

    Joined:
    Oct 4, 2018
    Posts:
    19
    Thanks
     
  3. sravanudutha

    sravanudutha

    Joined:
    Feb 6, 2020
    Posts:
    1
    Thanks a lot
     
  4. MertCIA

    MertCIA

    Joined:
    Dec 15, 2020
    Posts:
    1
    Thank you, it worked