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.
-
Is text field big enough to contain this text? Try to make it a bit larger to eliminate this option.obywan– obywan2018-01-11 08:36:09 +00:00Commented Jan 11, 2018 at 8:36
-
yes text is big enough already. I have make it more wide but the problem still not solved.Muhammad Faizan Khan– Muhammad Faizan Khan2018-01-11 10:28:48 +00:00Commented 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 thisobywan– obywan2018-01-11 13:00:49 +00:00Commented Jan 11, 2018 at 13:00
-
Its empty upon selection. I have manually addedMuhammad Faizan Khan– Muhammad Faizan Khan2018-01-12 04:17:15 +00:00Commented Jan 12, 2018 at 4:17
Add a comment
|
4 Answers
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);
}
}

