原文转自:http://blog.sina.com.cn/s/blog_bf9843bf0101fmwd.html
animationImages是数组类型,该数组必须包含的UIImage对象。您可以使用相同的图像对象多次在阵中。
例如:将一系列帧添加到一个数组里面,然后设置animation一系列属性,如动画时间,动画重复次数,还是看代码吧,直观
NSArray *magesArray = [NSArray arrayWithObjects:
[UIImage imageNamed:@"image1.png"],
[UIImage imageNamed:@"image2.png"],
[UIImage imageNamed:@"image3.png"],
[UIImage imageNamed:@"image4.png"],
[UIImage imageNamed:@"image5.png"],nil];
UIImageView *animationImageView = [UIImageView alloc]init];
[animationImageView initWithFrame:CGRectMake(0, 0, 131, 125)];
animationImageView.animationImages = imagesArray;//将序列帧数组赋给UIImageView的animationImages属性
animationImageView.animationDuration = 0.25;//设置动画时间
animationImageView.animationRepeatCount = 0;//设置动画次数 0 表示无限
[animationImageView startAnimating];//开始播放动画
NSTimer *myAnimatedTimer = [NSTimer scheduledTimerWithTimeIn
-(void) setNextImage
{
}