How to pause a UIImageView animation

前端 未结 6 1744
有刺的猬
有刺的猬 2021-02-06 17:03

I have an animation that I\'m displaying using a UIImageView:

imageView.animationImages = myImages;
imageView.animationDuration = 3;
[imageView startAnimating];
         


        
6条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-06 17:30

    @oddmeter just a little edit:

        animatedView.animationImages = images; //images is your array
        [animatedView startAnimating];
    
    
        //Then when you need to pause;
    
    [animatedView stopAnimating]; //Important!!
        animatedView.image = [images objectAtIndex: 0];
    

提交回复
热议问题