Author Topic: Detect which grid cell is active (centered on) when inside UIScrollView  (Read 2516 times)

par

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
This is probably an easy answer but I've been wasting my time trying to figure it out and hope that someone here can enlighten me.

I have a simple UIScrollView with a simple UIGrid inside it.  Inside the UIGrid I have 5 UIWidgets with UIDragScrollView and UICenterOnClick added to them.

Everything works perfectly.  With that said, I need to know when one of the 5 UIWidgets is "centered" on when its finished "centering" in the scroll view.  Is there a callback anywhere that accomplishes this easily?

Thanks!

PAR

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Detect which grid cell is active (centered on) when inside UIScrollView
« Reply #1 on: February 28, 2014, 09:15:40 PM »
UICenterOnChild has this functionality, and you can rip the code from it if you don't want it to actually do the centering.

par

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
Re: Detect which grid cell is active (centered on) when inside UIScrollView
« Reply #2 on: February 28, 2014, 09:48:21 PM »
Alright thanks!  I ended up snagging the code for UICenterOnClick and overriding the OnClick to do what I want along with calling what it calls by default.

Thanks much!

PAR