我有以下简单的UIImageView动画:停止动画的UIImageView逐渐平稳
-(void) setupTheAnimation {
self.imgView.animationImages = imagesArr;
[self.imgView setAnimationRepeatCount:-1];
self.imgView.animationDuration =0.9;
[self.imgView startAnimating];
[self performSelector:@selector(stopTheAnimation) withObject:nil afterDelay:4.0];
}
-(void) stopTheAnimation {
[self.imgView stopAnimating];
}
但是当动画停止,我不知道什么是它停止在最后一帧我面对的一个问题!所以动画的结局根本不流畅。
,所以我需要:
1)知道什么是最后一帧处的动画结束了,所以我把它作为动画的最后一个图像,这导致了平稳停车。
2)逐渐停止该动画,即在停止之前改变其持续时间以使其先减速并停止。
This is a link to the sample project。
好问题:) – 2013-02-18 14:03:24
我想说这需要作为一个自定义的动画属性实现在UIImageView的子类上,在这里你重复地将图层的内容设置为图像阵列中的图像提供定时功能。不会太难,但我不认为有可能通过'UIImageView'的'animationImages'来完成缓解效果。 – 2013-02-24 08:54:50