- Home /
UI Dropdown bug
So I have this problem :
As you can see the dropdown is hidden behind the Panel. Here are my Canvas settings: If you need further information, tell me! Thanks in advance.
Sounds good, doesn't work. Why should I break the entire Dropdown hierarchy while it should work without doing it?
I have the same problem. I'll try one solution that I came up with and then tell you if it works.
Answer by Amadeone · Jun 16, 2018 at 11:39 AM
I came up with a solution. Just place that script on the dropdown object: using UnityEngine; using System.Collections;
public class DropdownRepair : MonoBehaviour
{
public Transform dropdownList;
//It's public, so we can see if the script works.
public void Repair()
{
StartCoroutine(SetDropDownList());
}
void RepairPartTwo()
{
dropdownList.gameObject.GetComponent<Canvas>().overrideSorting = false;
}
IEnumerator SetDropDownList()
{
yield return new WaitForSeconds(0.1f);
if (dropdownList == null)
dropdownList = gameObject.transform.GetChild(3);
RepairPartTwo();
}
}
Also I'm a noob, so if someone knows how to correct this, please do it.
This topic is very old but, I found in my old projects and fount this line of code :
GetComponentInChildren<Canvas> ().sortingLayerName = "UI";
I basically just set the thing in a superior sorting layer. You can also just check your hierachy it kinds of work like this :
-back
-...
-front
Ok. At least I've solved that problem for myself.
Your answer
![](https://koobas.hobune.stream/wayback/20220612131808im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Unity Android Screen Glitch 1 Answer
UI Problem for Game 1 Answer
UI Dropdown Bug 0 Answers
Scrollbar keeps moving to upper side (regardless if top to bottom or bottom to top) 0 Answers
UI does not show up (mobile) 1 Answer