How to pause a UIImageView animation

前端 未结 6 1741
有刺的猬
有刺的猬 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:50

    This should do the trick: https://developer.apple.com/library/ios/#qa/qa2009/qa1673.html

    It basically tells you what you need to do to pause/resume any CALayer based animation.

    If you feel uncomfortable using CALayer methods on UIImageView controlled animation, you could always just make the UIImage array based animation yourself. The code needed is very short, you can take it from here: http://rssv2.blogspot.com/2011/04/animating-series-of-images-with-calayer.html

提交回复
热议问题