Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by andyasj · May 09, 2017 at 05:49 AM · uidropdown

Dropdown not showing after canvas set active

Unity 5.6.0f3

Place a Dropdown on a canvas (Screen Space - Overlay).

Run.

Dropdown works fine with default options.

Set canvas inactive.

Set canvas active.

Dropdown no longer shows. It is still there but I can not get it to show (except in Scene view by dragging it to the side of the canvas).

Any ideas?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

6 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by xRoachx · Aug 17, 2018 at 09:24 AM

For those who still have the problem and want a simple workaround:

Create this simple script and add it to the DropDown GameObject:

 public class DropDownFix : MonoBehaviour {
 
     public string sortingLayer = "UI"; //Or what ever layer you want it to be
 
     public void OnDropDownClicked() {
         Transform droplist = transform.Find("Dropdown List");
 
         if (droplist != null) {
             droplist.GetComponent<Canvas>().sortingLayerName = sortingLayer;
         }
     }
 }

And just add an Event Trigger to the dropDown Gameobject with an Pointer Click event calling the OnDropDownClicked() function.

alt text


temp.png (10.3 kB)
Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image xRoachx · Aug 17, 2018 at 09:25 AM 0
Share

Technically you don't really need the "droplist != null" but you never known.

avatar image
1

Answer by Dhaval1992 · May 09, 2017 at 06:15 AM

Try to set the DropDown's anchor point as per your need and than check.

Comment
Add comment · Show 10 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image andyasj · May 10, 2017 at 06:06 PM 0
Share

Anchor point makes no difference.
This problem occurs with a new scene, new canvas and new default dropdown - easy to reproduce. I can not understand why this has not been noticed before. Not only is the Dropdown List not visible but the Dropdown itself becomes frozen. (Only a problem with ScreenSpaceOverlay)

avatar image Dhaval1992 andyasj · May 11, 2017 at 05:59 AM 0
Share

Hi, Just seen that glitch in unity 5.6 in my PC also. If we are activating/deactivating canvas with drop down list, than drop down list is not visible in the game view.

But i found one workaround on it: 1. Create a empty Game Object inside the Canvas. 2. Than put all the UI elements along with your Drop Down in this empty Game Object. 3. And do the active/deactivate function on that Game Object rather doing it on Canvas.

Try if it works for you also.

avatar image lulitd Dhaval1992 · May 29, 2017 at 03:09 PM 0
Share

Thanks for this work around. Been scratching my head for days trying to figure out a solution

Show more comments
avatar image andyasj · May 11, 2017 at 06:21 AM 0
Share

That works fine thanks but leads to other problems for me. I will wait a while to see if it gets fixed. I tried to report a bug but there seems to be a bug in the bug reporting app and it keeps failing!

avatar image Dhaval1992 andyasj · May 11, 2017 at 06:43 AM 0
Share

What problem? Share it, if i can help you on it.

avatar image andyasj · May 11, 2017 at 07:13 AM 1
Share

O$$anonymous$$ now. Bug reported (it was a windows problem).

avatar image lulitd andyasj · May 29, 2017 at 03:10 PM 0
Share

Also experienced the same glitch(also on windows) do you have link to the bug submission?

avatar image andyasj · May 30, 2017 at 09:08 AM 0
Share

https://fogbugz.unity3d.com/default.asp?909895_7c0pqe2a2o8d2fui

avatar image lulitd andyasj · Jun 06, 2017 at 02:35 PM 0
Share

Thanks. Glad to see that its been patched.

avatar image
1

Answer by GLonaa5baVCBOkT7 · Aug 08, 2017 at 07:28 PM

Not sure if this will fix your issue, but I was having a very similar issue. Unity adds a canvas component to the Dropdown template at run-time with Override Sorting checked and the sorting layer set to Default instead of UI. To fix I copied the values from the canvas component after unity created it and pasted it into a canvas component I added myself and then set the layer to UI (only difference I saw was Order in Layer was 30000). Alternatively you could uncheck override sorting but then you'd have to make sure nothing else clips it. No idea why it doesn't copy the sorting layer from the parent object at run-time.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by ZzaAakK_Gaming · Aug 23, 2017 at 10:50 AM

Hi folks, I'm fairly new to Unity as well, and came across this post because I had the same issue. I found a way to solve the problem though. I noticed, in the editor, that the component 'Dropdown List' is never deleted, only deactivated with the rest of the object. As the canvas('Dropdown List') is created at runtime, all you have to do is make a call to delete the canvas as the dropdown box is shown again. The next time you click it the dropdown box will appear again.

 DestroyObject (dropDownBox.GetComponentInChildren<Canvas> ().gameObject);

I hope this helps!

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image javier-mazzurco · Jun 03, 2018 at 10:38 PM 0
Share

Excelent! Thanks ZzAak$$anonymous$$_Ga$$anonymous$$g

avatar image
0

Answer by senkage · Oct 23, 2018 at 04:04 PM

I solved this issue by adding a Canvas component to the "Template" object and uncheck "Override Sorting", so that the dynamically generated "Dropdown List" will appear on the correct sorting layer.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image senkage · Oct 23, 2018 at 05:14 PM 0
Share

Sorry let me correct myself: Ins$$anonymous$$d of unchecking "Override Sorting", you need to check "Override Sorting" and then select the right sorting layer (same one as your dropdown). This is because the actual Dropdown List object copies settings from "Template" object but by default it will set to Default sorting layer, causing it possibly goes behind other layers.

  • 1
  • 2
  • ›

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

11 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

TextMeshPro dropdown default value change 0 Answers

Extending dropdown options to use something like ValueMembers? 0 Answers

Unable to reset dropdown value to -1 1 Answer

How to use options in the Dropdown menu UI? 2 Answers

4.6 combo/dropdown box 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges