-(void)viewDidLoad
[super viewDidLoad];{
//序列帧动画要播放的图片数组 imageView.animationImages
//动画时长 imageView.animationDuration
//动画重复次数 imageView.animationRepeatCount
//开始动画 [imageView startAnimatting]
//结束动画 [imageView stopAimatig]
//是否正在执行动画 [imageView isAnimating]
}
-(IBAction)eatBirdAction:(UIButton *)sender{
//创建可变数组images,负责存放要播放的图片数组
NSMutableArray *images = [NSMutableArray array];
for(NSIntegr i = 0;i<40; i++)
{//根据i来加载图片,添加到可变数组images里面
NSString *imageName = [NSString stringWithFormat:@"eat_02%ld.jpg",i];
//根据格式化的图片加载图片image
UIImage *image = [UIImage imageNamed: imageName];
[images addObject :image]; //将图片添加到数组images中去.
} //设置动画图片数组
self.tomCatView.animationImages =images;
//设置动画时长
self.tomCatView.animationDuration = 40*0.075;
//设置动画步骤
self.tomCatView.animationRepeatCount =1;
//开始动画
[self.tomCatView.StartAnimating];
其余按钮制作皆可按上面步骤完成。