【发布时间】:2017-04-03 22:09:25
【问题描述】:
我有一组需要动画的 UISlider 控件,从一个值到另一个值。
对动画的要求是它需要匹配(尽可能接近)来自Android平台的AnticipateOvershootInterpolator的效果。AnticipateOvershootInterpolator 的文档提到:
一个插值器,改变开始向后然后向前抛出 并超过目标值,最后回到最终 价值。
Here is a video 带有动画,取自this blog。
这是我现有的结构。对于这个问题,重点将放在 1 个 UISlider 上。
[UIView animateWithDuration:1.0
delay:1.0
options:UIViewAnimationOptionCurveEaseOut
animations:^{
[self.slider setValue:100 animated:YES];
} completion:^(BOOL finished) {
if (finished) {
//some other stuff
}
}];
我希望为options 参数(我的代码中的UIViewAnimationOptionCurveEaseOut,遗憾的是与所需的效果不匹配)找到一个合适的值来匹配AnticipateOvershootInterpolator 效果。
我也知道用animateWithDuration方法可能无法达到这种效果,因此欢迎任何建议。
如何在iOS平台上实现AnticipateOvershootInterpolator效果?
【问题讨论】: