美文网首页
ios UIimageView帧动画

ios UIimageView帧动画

作者: 一个萝卜X个坑 | 来源:发表于2018-09-29 11:05 被阅读27次
//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帧动画

      本文链接:https://www.haomeiwen.com/subject/tayvoftx.html