- Home /
how to keep dropdown's tempelate at the centre of the screen regarless of position of dropdown bar ?
I have a dropdown at the bottom of the screen, with over 50 items in the list
when i tap on dropdown which is at the bottom of the screen, it should show options sin the center of the screen and not the bottom, is it possible ? canvas has verticle layout group component and so position of dropdown changes at runtime, yet tempelate should appear in the middle of the screen no matter where the dropdown is.
Answer by ranch000 · Nov 20, 2019 at 04:55 AM
Add a script to the dropdown's template that onEnable, reparents it out of the dropdown in the layout group to an outer parent. Then set the template's height and width as required. One thing to keep in mind is that if the dropdown bar is positioned in the center, the runtime template will also appear in the center, overlapping the bar.
Your answer
Follow this Question
Related Questions
ALWAYS SHOW DROPDOWN LIST 0 Answers
TextMeshPro dropdown default value change 0 Answers
Extending dropdown options to use something like ValueMembers? 0 Answers
How to use options in the Dropdown menu UI? 2 Answers
4.6 combo/dropdown box 2 Answers