Author Topic: UIPopupMenu doesn't scale when in a scroll view's item row  (Read 9185 times)

Goosery

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
UIPopupMenu doesn't scale when in a scroll view's item row
« 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. 

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIPopupMenu doesn't scale when in a scroll view's item row
« Reply #1 on: March 04, 2013, 09:30:54 PM »
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.

Goosery

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Re: UIPopupMenu doesn't scale when in a scroll view's item row
« Reply #2 on: March 04, 2013, 09:35:27 PM »
that is a brand new popup created with the  "create a widget" menu. 

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIPopupMenu doesn't scale when in a scroll view's item row
« Reply #3 on: March 04, 2013, 09:37:03 PM »
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.

Goosery

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Re: UIPopupMenu doesn't scale when in a scroll view's item row
« Reply #4 on: March 04, 2013, 09:39:05 PM »
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?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIPopupMenu doesn't scale when in a scroll view's item row
« Reply #5 on: March 04, 2013, 09:40:07 PM »
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.

Goosery

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Re: UIPopupMenu doesn't scale when in a scroll view's item row
« Reply #6 on: March 04, 2013, 09:41:37 PM »
sweet! thx for the tip. I'll try it out!

Goosery

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Re: UIPopupMenu doesn't scale when in a scroll view's item row
« Reply #7 on: March 04, 2013, 09:44:42 PM »
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?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIPopupMenu doesn't scale when in a scroll view's item row
« Reply #8 on: March 05, 2013, 12:33:39 PM »
Yeah you should be able to do that just fine.