Author Topic: Scroll view search  (Read 5451 times)

gamedivisionuk

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 36
    • View Profile
Scroll view search
« on: June 02, 2014, 05:56:34 AM »
What I'm trying to do:
I input data on one line then click search,it's then searching what's in the scroll view

I want the scroll view to show the results of my search by snapping it to the middle,so if I have 100 labels within the scroll view,soon as I click search it will file through the scroll view and show the result directly in the middle of the scroll view


Thank you

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Scroll view search
« Reply #1 on: June 03, 2014, 05:03:43 PM »
Then you find the position of the label you want to go to, and you set the ClipOffset to that and move the panel opposite that.

If you want it to animate towards that positions, then you have to tween both of those values. Look inside TweenPosition how it's done for position and make your own for tweening clipoffset.

There might be a built in method too, but I'm not sure. Otherwise look at how CenterOnChild.cs works.