iPhone : Best way to detect the end of UIImageView image sequence animation

前端 未结 3 1754
情深已故
情深已故 2021-01-18 00:41

We know that UIImageView has a very nice support for image sequence animation. We can easily create an array of UIImage objects, set the animationImages

3条回答
  •  情话喂你
    2021-01-18 01:22

    The isAnimating property on UIImageView should go to NO when it's done animating. It's not a formal property, though, so you can't set up observation on it. You can poll it on a fine-grained timer (like CADisplayLink's).

    There's no "animation completed" delegate for this, if that's the sort of thing you're looking for. The timing can be variable based on loading delay of the images, etc, and no, there's no sure-fire way to know precisely when it's done.

    The image animation stuff on UIImageView is a convenience, and not heavyweight enough to do serious animation work with. Consider rolling your own if you need that kind of precision.

提交回复
热议问题