UIImageView * Animation = [UIImageView alloc] initWithFame:[UIScreen mainScreen] bounds]];
[self.view addSubview:Animation];
//設(shè)置動(dòng)畫幀
Animation.animationImages=[NSArray arrayWithObjects:
[UIImage imageNamed:@"1.jpg"],
[UIImage imageNamed:@"2.jpg"],
[UIImage imageNamed:@"3.jpg"],
[UIImage imageNamed:@"4.jpg"],
[UIImage imageNamed:@"5.jpg"],nil ];
//設(shè)置動(dòng)畫總時(shí)間
Animation.animationDuration=1.0;
//設(shè)置重復(fù)次數(shù),0表示不重復(fù)
Animation.animationRepeatCount=0;
//開始動(dòng)畫
[Animation startAnimating];
使用延時(shí)來完成動(dòng)畫結(jié)束時(shí)的回調(diào)
[self performSelector:@selector(doOtherAction) withObject:nil afterDelay:ANIMATION_TIME];