Author Topic: Drag&Drop between scrollview's synch with scrollbar doesn't work well.  (Read 2385 times)

leegod

  • Jr. Member
  • **
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 90
    • View Profile
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.

« Last Edit: August 15, 2014, 10:07:38 PM by leegod »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
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.