ios UIimageView帧动画
程序员文章站
2024-01-19 12:57:46
...
//NSArray *_arrayImages4Connecting; 几张图片按顺序切换
- (void)startAnimation4Connection {
NSArray * _arrayImages4Connecting = [NSArray arrayWithObjects:
[UIImage imageNamed:@"a1.png"],
[UIImage imageNamed:@"a2.png"],
[UIImage imageNamed:@"a3.png"],
[UIImage imageNamed:@"a4.png"],
nil];
[self.imgView setAnimationImages:_arrayImages4Connecting];
[self.imgView setAnimationRepeatCount:0];
[self.imgView setAnimationDuration:3.0f];
[self.imgView startAnimating];
}
//停止删除
-(void)imgAnimationStop{
[self.imgView.layer removeAllAnimations];
}