Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIImageView Animation not keep last frame

I am using This methods to animate an UIImageView :

    [imageView stopAnimating];
    imageView.animationImages = set;
    imageView.animationDuration = 0.4;
    imageView.animationRepeatCount = 1;
    [imageView startAnimating];

that set is NSMutableArray of the images. my problem is that when the animation finished, the UIImageView not keep the last frame from set and bring back the image that was in the imageview before the animation.

how i can make the last frame to be the image of the imageview?

like image 622
YosiFZ Avatar asked Apr 20 '12 12:04

YosiFZ


1 Answers

Before you start animating, set the last image in the image view imageView.image = yourLastImage; and then start the animation. After the animation is complete the image view will show yourLastImage.

like image 115
TompaLompa Avatar answered Oct 20 '22 00:10

TompaLompa