UIImageView Animation delay between frames?

后端 未结 4 2198
太阳男子
太阳男子 2020-12-22 04:52

I am trying to create an animation using a UIImageView with an array if images. It works great, except that I need a different delay between some of the frames. In an animat

4条回答
  •  南笙
    南笙 (楼主)
    2020-12-22 05:21

    It may seem hacky, but:

    From UIImageView documentation:

    animationImages

    An array of UIImage objects to use for an animation.

    @property(nonatomic, copy) NSArray *animationImages
    

    Discussion

    The array must contain UIImage objects. You may use the same image object more than once in the array. Setting this property to a value other than nil hides the image represented by the image property. The value of this property is nil by default.

    So you need to add your UIImage several times to the array for a delay.

提交回复
热议问题