我有一个图像数组动画,但它是一个连续循环。如何让它只循环一个循环并在最后一帧停止?
- (void) balloonAnimation
{
NSMutableArray *balloonAnimationImages = [NSMutableArray arrayWithCapacity:27];
for (NSInteger i = 0; i < 27; i++) {
NSString *nameOfImage = [NSString stringWithFormat:@"balloons%d.png", i+1];
UIImage *image = [UIImage imageNamed:nameOfImage];
[balloonAnimationImages addObject:image];
}
//animate here
self.imgBalloon.animationImages = balloonAnimationImages;
self.imgBalloon.animationDuration = 5.0f;
[self.imgBalloon startAnimating];
}