在带有动画的UIImageView上显示多个图像

时间:2019-01-09 06:40:39

标签: ios objective-c animation imageview

我有一个imageUrl数组,我需要使用Fade Animation在无限的时间内在单个UIImageView上显示该数组中的所有图像。如何实现呢?

目前我正在使用此代码,但仅应用一次动画:

CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"contents"];
//animation.calculationMode = kCAAnimationDiscrete;
animation.duration = 30.0;
animation.values = imageListArray;
animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
animation.repeatCount = 0;
animation.removedOnCompletion = NO;
animation.autoreverses = true;
animation.fillMode = kCAFillModeForwards;
[_loyaltyImageView.layer addAnimation:animation forKey:@"animation"];

0 个答案:

没有答案