views:

13

answers:

1

Hello all.

In UIScrollView, we can scroll the view and it has a accelerate and decelerate effects, also including bouncing.

Can anyone tell me how to animate view's move like that?

say, I have a imageview on screen, if I want to "throw" this imageview to somewhere, how can I animate the movement of the imageview with that accelerate first then slow down then finally arrived effect?

Thanks

A: 

Not what UIScrollView does, but the standard way would be to set your animation's animation curve to UIViewAnimationCurveEaseInOut.

If you use CA animations, you can also define your own custom animation curves by creating a corresponding CAMediaTimingFunction with +[CAMediaTimingFunction functionWithControlPoints::::]. Then set your animation's timingFunction property to the instance you created.

Ole Begemann
I will try it, thanks for your suggestion.
Jack