views:

83

answers:

1

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:
                                 [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];
+1  A: 

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"];
Vladimir
You have no idea how happy you just made me with this simple answer. Thank you very much!!
NextRev