ios 动画 创建一个UIImageView并将其属性设置animationImages为UIImages 的数组

NSArray *animationFrames = [NSArray arrayWithObjects:
  [UIImage imageWithName:@"image1.png"],
  [UIImage imageWithName:@"image2.png"], 
  nil];

UIImageView *animatedImageView = [[UIImageView alloc] init];
animatedImageView.animationImages = animationsFrame;
[animatedImageView startAnimating];

如果你的目标是iOS 5,你可以直接在UIImage没有UIImageView使用的情况下进行

    +(UIImage *)animatedImageWithImages:(NSArray *)images duration:(NSTimeInterval)duration 

例如,

    [UIImage animatedImagesWithImages:animationFrames duration:10];
原文地址:https://www.cnblogs.com/shenlaiyaoshi/p/8342527.html