Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIView animateWithDuration: duration: animations: completion: seems to have a default transition?

In my program, I want to create an animation that will move at a constant speed. It appears that the animation starts slowly, speeds up and then finishes slowly. Is there any way to change this?

like image 483
Fitzy Avatar asked May 29 '12 07:05

Fitzy


1 Answers

You can change this setting by using the animateWithDuration:delay:options:animations:completion: alternative. Send an UIViewAnimationOption mask for the option parameter. These are the options that you're interested in :

 UIViewAnimationOptionCurveEaseInOut 
 UIViewAnimationOptionCurveEaseIn   
 UIViewAnimationOptionCurveEaseOut 
 UIViewAnimationOptionCurveLinear 

The documentation says that UIViewAnimationOptionCurveEaseInOut is the default value.

See the documentation for more details : http://developer.apple.com/library/ios/#documentation/uikit/reference/uiview_class/uiview/uiview.html

like image 197
adig Avatar answered Sep 19 '22 05:09

adig