1.系统UIImageView 多张图片组成动画
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
/**
* UIImageView 动画
* Memory-23M
*/
-(
void
)gifPlay1
{
// NSArray *array=@[@"image0.png",@"image1.png",@"image2.png"];
// UIImageView *imgview= [UIImageView imageViewAnimation:CGRectMake(50,80, 550/2, 200) imageNames:array duration:1];
UIImageView* animatedImageView = [[UIImageView alloc] initWithFrame:CGRectMake(50,80, 550/2, 200)];
animatedImageView.animationImages =@[[UIImage imageNamed:@
"image0"
],
[UIImage imageNamed:@
"image1"
],
[UIImage imageNamed:@
"image2"
],
];
animatedImageView.animationDuration = 1.0f;
animatedImageView.animationRepeatCount = 0;
[
self
.view addSubview: animatedImageView];
[animatedImageView startAnimating];
}
|
2.利用第三方库
1)IImageView-PlayGIF YFGIFImageView