我有以下代码来动画音量表:
float meterIndexFloat = volume * 6;
int meterIndex = (int)roundf(meterIndexFloat);
NSMutableArray *litImages = [[NSMutableArray alloc] init];
for(int i=0; i < meterIndex; i++) {
[litImages addObject:[volumeMeterImages objectAtIndex:i]];
}
volumeMeter.animationImages = litImages;
volumeMeter.animationDuration = 0.4;
volumeMeter.animationRepeatCount = 1;
[volumeMeter startAnimating];
它运行良好,但我想在它自身反转时放慢动画速度。现在持续时间是0.4,但是当图像向相反方向移动时,我想让它慢下来说0.7。修改它的最简单方法是什么?
谢谢!