Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: leegod on August 15, 2014, 09:52:17 PM

Title: Drag&Drop between scrollview's synch with scrollbar doesn't work well.
Post by: leegod on August 15, 2014, 09:52:17 PM
Scene made from ngui's example 11,

drag & drop item to other container doesn't make related scrollbar synched perfectly.

I have container A, B  and container A has many card object, started moving card from A to B, B looks can contain 5 cards.

so after move 5 cards, move 6th card to B, at here B's scrollbar should be longed by 1 card's width, but doesn't updated automatically.

when move 7th card, scrollbar longed normally, but still lack by amount of  1 card's width.

This manually can be fixed at runtime when user scroll container B,

but I want it to automatically synched perfectly.

I almost maintain same option with example11, but only turn on option at UIScrollView's [Cancel Drag If Fits].

So this is also example11's problem. It also does not synched well until user manually drag.

To manually revise this phenomenon,

Calling UIScrollView's UpdateScrollBars(true) after OnDragDropRelease(GameObject obj) (little time after like some frames) can update scrollbars well automatically,

but is this best way?

Am I missing something?

Thanks.

Title: Re: Drag&Drop between scrollview's synch with scrollbar doesn't work well.
Post by: ArenMook on August 16, 2014, 10:07:33 AM
Depends on how you do your drag  & drop operation here. How do you reparent objects? Do you call MarkParentAsChanged? But if calling UpdateScrollbars works, stick to it.