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
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

[5.2.2] Scale Dropdown Items

Discussion in 'UGUI & TextMesh Pro' started by Acissathar, Nov 11, 2015.

  1. Acissathar

    Acissathar

    Joined:
    Jun 24, 2011
    Posts:
    669
    Hi, I'm relatively new to trying out Unity's uGUI, and I've run into an issue with trying to scale up the dropbox and its items.

    I've tried setting the dimensions of the dropbox itself (right side), but that leaves the items as tiny and trying to cram inside of it.

    I've also tried setting the items in the template (left side), but then the items are too large and overlap. I'm sure I'm just missing something obvious, but any help is appreciated!
     

    Attached Files:

  2. Strategos

    Strategos

    Joined:
    Aug 24, 2012
    Posts:
    255
    I'm having the same issue. If I add code to force the dropdown items to be larger the viewport doesn't expand to fit them.
    As less people seem to answer UI questions I'm not holding out much hope here, but if anyone has some info on how to make dropdown items larger I'd appreciate it.

    The particular issue is that at high resolution the list items are too small to click.
     
  3. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637
    @Acissathar

    hi, I think you and @Strategos are having trouble with basic canvas setup, unless it's something else, so far I haven't noticed this kind of issue with any UI element.

    To change item height, just navigate to template under dropdown, change Item box height. To change item text size, select template "Item Label" and change it's font size.

    That's all you have to do, never used dropdown and it took 2 minutes or so. Both items are available from Dropdown component directly.

    Reason for not getting proper font size just might be something else - I bet you haven't checked your canvas settings? Maybe your UI is just scaling along viewport size? Unless you lock it with "Scale with Screen Size" to target resolution, don't expect some magic to happen, scaling viewport will cause all kinds of (predictable once familiar with system) "scaling" and movement of UI elements. World space canvases are a bit different thing also but I take it you are using Screen Space Canvas.

    IMHO - check out all the Unity UI tutorials, these will pretty much answer all the questions related to UI basics.
     
    DDoop likes this.
  4. Acissathar

    Acissathar

    Joined:
    Jun 24, 2011
    Posts:
    669
    My problem was 4 months ago and it's been solved in the mean time ;) Unfortunately I don't really remember what my issue was, I think it was something about the scale being set to some weird number (the items were being generated dynamically) which were fixed by a simple .SetScale after instantiation.