例如:将一系列帧添加到一个数组里面,然后设置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
{
}