3

I have dropdown of Unity UI and it has one option. Its first option is selected but i dont why its selected option is not showing.

enter image description here enter image description here

4
  • Is text field big enough to contain this text? Try to make it a bit larger to eliminate this option. Commented Jan 11, 2018 at 8:36
  • yes text is big enough already. I have make it more wide but the problem still not solved. Commented Jan 11, 2018 at 10:28
  • I guess you can hit Play in Editor, select your option in Dropdown and take a look at Label object under Dropdown object in Hierarchy. It should be like this Commented Jan 11, 2018 at 13:00
  • Its empty upon selection. I have manually added Commented Jan 12, 2018 at 4:17

4 Answers 4

11

If you added that option through scripts you need to call Dropdown.RefreshShownValue();

Sign up to request clarification or add additional context in comments.

Comments

0

You have to attached Text into Caption Text

Comments

0

I solved this just by changing the font size of lable text under the dropdown. I delete the font size number, and it showed up. You can try.

Comments

0

One "easy to understand" way is to add a script to "template":

using UnityEngine;
using TMPro;

public class DropdownHeightAdjuster : MonoBehaviour
{
    
    RectTransform myself;
    public float desiredHeight = 330f;
    
    void Start()
    {
        myself = GetComponent<RectTransform>();
        myself.sizeDelta = new Vector2(myself.sizeDelta.x, desiredHeight);
    }

    
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.