Author Topic: Adjust localPosition of UIScrollview programatically  (Read 2819 times)

friderator

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 4
    • View Profile
Adjust localPosition of UIScrollview programatically
« on: July 18, 2014, 01:46:06 PM »
I am adjusting the localPosition of a UIScrollView programatically by passing it a new Vector3.  The scrollView successfully updates its position to where I want it, the the clipping on the panel does not update.

I have tried moving the panel with MoveRelative, MoveAbsolute, and SpringPanel.Begin.  None of which change the position of the scrollview.

What am I don't wrong?

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Adjust localPosition of UIScrollview programatically
« Reply #1 on: July 19, 2014, 07:52:46 AM »
Set clipOffset in the UIPanel to the negative of localposition.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Adjust localPosition of UIScrollview programatically
« Reply #2 on: July 19, 2014, 12:43:57 PM »
Or just use UIScrollView.SetDragAmount.

friderator

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 4
    • View Profile
Re: Adjust localPosition of UIScrollview programatically
« Reply #3 on: July 21, 2014, 11:52:25 AM »
I tried setting the offset of the clipping on the panel, but was giving me some weird side effects.

SetDragAmount works great, thank you!