UIView animateWithDuration:duration:animations:completion:似乎有默认转换?
在我的程序中,我想创建一个以恒定速度移动的动画。 看起来动画开始缓慢,加速然后慢慢结束。 有没有办法改变这个?
您可以使用animateWithDuration:delay:options:animations:completion:
alternative来更改此设置。 为option参数发送UIViewAnimationOption
掩码。 这些是您感兴趣的选项:
UIViewAnimationOptionCurveEaseInOut UIViewAnimationOptionCurveEaseIn UIViewAnimationOptionCurveEaseOut UIViewAnimationOptionCurveLinear
文档说UIViewAnimationOptionCurveEaseInOut
是默认值。
有关详细信息,请参阅文档: http : //developer.apple.com/library/ios/#documentation/uikit/reference/uiview_class/uiview/uiview.html
您应该使用,这将解决您的问题
[UIView animateWithDuration:duration delay:0 options:UIViewAnimationOptionCurveLinear animations:^{ //code with animation } completion:^(BOOL finished) { //code for completion }];