ios UIimageView帧动画

//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];
}

你可能感兴趣的:(ios UIimageView帧动画)