Freeze last frame of animation?
Is there a way to freeze the last frame of my animation in my iphone app? Here's my code so far.
popup.animationImages = [NSArray arrayWithObjects:
开发者_JS百科 [UIImage imageNamed:@"picture1.png"],
[UIImage imageNamed:@"picture2.png"],
[UIImage imageNamed:@"picture3.png"],
[UIImage imageNamed:@"picture4.png"],
[UIImage imageNamed:@"picture5.png"],
[UIImage imageNamed:@"picture6.png"],
[UIImage imageNamed:@"picture7.png"], nil];
popup.animationDuration = 1.750567;
popup.animationRepeatCount = 1;
[popup startAnimating];
[self.view addSubview:popup];
When animation stops UIImageView shows UIImage set in its image
property. So you should just set it to the last frame of your animation:
popup.image = [UIImage imageNamed:@"picture7.png"];
精彩评论