Author Topic: UIScrollView activate smth if centered  (Read 3116 times)

AndreasRk

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 6
    • View Profile
UIScrollView activate smth if centered
« on: May 26, 2014, 10:12:52 AM »
Hi,

I hope my question is not to trivial, I do not want to bother too much.

I am working with a UIScrollView and the object that is centered shall alter the surrounding (sounds a little drastic, it shall just set some labels and sprites so they represent the items values).

I was wondering, if there is something that already does that. I am using CenterOnChild in a modified version right now, but maybe there is something like a call as "OnClick" - I thought down the line of "OnCenter()" that is executed by every script on the Scrollview?
I just don't want to miss out on some easy way instead of customizing "foreign" code. And Tasharen was able to positively surprise me more than once :-)




ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIScrollView activate smth if centered
« Reply #1 on: May 26, 2014, 11:13:59 PM »
Currently UICenterOnChild.onFinished will tell you when the scroll view finishes centering on some object. Alternatively you can just access UICenterOnChild.centeredObject to determine it yourself.

AndreasRk

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: UIScrollView activate smth if centered
« Reply #2 on: May 27, 2014, 08:27:12 AM »
Thank you very much, your support really is top notch - as far my experiance go.

I just learned how to use delegates and I am happy.

Thanks mate, have a good one.