Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: leegod on January 27, 2015, 02:21:58 AM

Title: Scroll View's inside item's alignment problem.
Post by: leegod on January 27, 2015, 02:21:58 AM
Hi.
As you can see in this short video,

http://youtu.be/T61Jd5pbDD8 (http://youtu.be/T61Jd5pbDD8)

First 2 cards at left corner of scrollview stacked(overlapped). Of course this is not intended, I don't want them stacked.

Why this occur and how to fix?
(This occur when I draw more than 4 cards for initial draw number)

Title: Re: Scroll View's inside item's alignment problem.
Post by: ArenMook on January 27, 2015, 04:45:51 AM
I'm not sure what I'm supposed to be seeing in that video. Stacked? Overlapped? I'm not seeing any overlap... you started a drag operation set to clone the object, then you dropped this cloned object into the scroll view. By default NGUI's drag & drop example script will destroy the clone when this happens, but you don't seem to be doing that, so it just adds this clone to the list, duplicating the object.
Title: Re: Scroll View's inside item's alignment problem.
Post by: leegod on January 27, 2015, 10:45:18 PM
Most left positioned card (drawing is Red Ball likely) actually stacked with other card. So it looks like 4 cards there, but actually there are 5 cards.

So I dragged that stacked card to outside and drop, it went to its intended position. (drawing is fire bolt likely)

Title: Re: Scroll View's inside item's alignment problem.
Post by: ArenMook on January 28, 2015, 02:30:56 AM
Did you call the grid's Reposition() function after adding your content? If you don't do it, the content won't be moved to its proper place.
Title: Re: Scroll View's inside item's alignment problem.
Post by: leegod on January 28, 2015, 08:28:29 PM
Did you call the grid's Reposition() function after adding your content? If you don't do it, the content won't be moved to its proper place.

Yes I did handGrid.Reposition();  after every card draw and final draw step's done.
Title: Re: Scroll View's inside item's alignment problem.
Post by: ArenMook on January 29, 2015, 12:55:26 PM
After every card draw? That doesn't make sense to me...  add your all cards at once, then call Reposition().
Title: Re: Scroll View's inside item's alignment problem.
Post by: leegod on January 31, 2015, 08:10:55 PM
After every card draw? That doesn't make sense to me...  add your all cards at once, then call Reposition().

Thank much!! This solves problem!