Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: Goosery on March 04, 2013, 02:14:37 PM
-
Hi!
So I have a scroll view that's got a UITable in it, the table will have a list of say 10 items. Each of these items is a prefab that represents a row. e.g. InboxRow.. in the InboxRow prefab I've got buttons, labels, and they always work perfectly in this scrollview.
However now I have requirement to include a dropdown. The drop down also shows perfectly.. but the problem is when I click the dropdown, the actualy "drop-down List" is huge. I can make textscale of the popup a better size, but the actual dropdown box is still huge. Is there a work around for this? Thanks
the blue "Message" button is the uipopup, that big gray thing is the drop down box in question.
I've attached a screenshot.
-
All I can say is that something is wrong with your popup setup. Create a default popup list using the widget tool and compare it closely with what you have. You likely have the popup script in the wrong place, such as on the background widget.
-
that is a brand new popup created with the "create a widget" menu.
-
As I said look at your setup. Double-check the scales of all your game objects leading up to your popup. All objects must have a scale of (1, 1, 1), including the popup itself. UIRoot excluded.
-
Yeah scale, that's exactly the problem.. but I'm not sure what causes this. Here's the issue.
The main UI root prefab's scale is 1x1x1 but when I instantiate the prefab the scale of the inbox automatically becomes 0.09 or something ridiculously small like that... any idea what I did wrong to make it do that?
-
UIRoot isn't supposed to be 1. It's supposed to be 2/ScreenHeight by default, which is a small number.
You need to use NGUITools.AddChild(parent, prefab) to instantiate objects.
-
sweet! thx for the tip. I'll try it out!
-
oh crap.. my prefabs are resources that are instantiated with names due to the runtime dynamic nature of the list/items... it was done with Resources.Load() .. how do I do that with ngui? can I still load the prefab from resource and then call NGuiTool.addchild to that instance instead of the prefab?
-
Yeah you should be able to do that just fine.