如何设置动画
_background.animationImages =array; // 加载army数组里面的UIImage
_background.animationDuration = count * 0.1; // 设置动画时间
_background.animationRepeatCount = 1; // 设置动画播放次数
- (void)Action:(NSString *)name andCount:(int)count;
{
// 设置一个可变数组用来存放UIImage
[array addObject:actionImage];
NSMutableArray *array = [[NSMutableArray alloc]init];
for (int i= 0; i < count; i++) {
// 从文件中读取图片的路径,根据i和name的值,使文件命不断改变
NSString *path = [[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"%@_%02d",name,i] ofType:@"jpg”];
// 冲文件路径读取出来的图片转化为UIImage
UIImage *actionImage = [[UIImage alloc]initWithContentsOfFile:path];
_background.animationImages =array; // 加载army数组里面的UIImage
_background.animationDuration = count * 0.1; // 设置动画时间
_background.animationRepeatCount = 1; // 设置动画播放次数
[_background startAnimating]; // 开始动画