I try to solve a problem for a few weeks, but I don’t find answer.
I try to get that the last frame freeze when the animation ends.
This is my animation code:
-(IBAction)play {
image.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"1.png"],
[UIImage imageNamed:@"2.png"],
[UIImage imageNamed:@"3.png"],
[UIImage imageNamed:@"4.png"],
[UIImage imageNamed:@"5.png"],
[UIImage imageNamed:@"6.png"],
[UIImage imageNamed:@"7.png"],
[UIImage imageNamed:@"8.png"],
[UIImage imageNamed:@"9.png"],
[UIImage imageNamed:@"10.png"],
[UIImage imageNamed:@"11.png"],
[UIImage imageNamed:@"12.png"],
[UIImage imageNamed:@"13.png"],nil];
[image setAnimationRepeatCount: 1];
image.animationDuration = 0.5;
[image startAnimating];
}
-(IBAction)stop{
[image stopAnimating];
}
When I press the button play, the animation runs and when I press button stop, the animation stop and disapear the image.
I like do this thing without stop button, when the animation end, the last frame is visible.
Thank you for the help.
I don’t know if it is the easiest way to do it, but it works. Here you are: