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];
posted @ 2018-01-24 17:03  神来钥匙-陈诗友  阅读(219)  评论(0编辑  收藏  举报