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

Answers


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"];

Need Your Help

Formatting monetary values - search and replace / Regex?

regex currency replace

I wonder if anyone can help with this? I've got text documents (that have gone through a dictation/transcription package) with amounts of money that need to be put in the correct format.

UIImage drawinrect method doesn't draw image

ios objective-c uiimage

I have created a cust UIView class so that I can display the contents of a Map object. After much research, I am still unable to determine why the method below doesn't draw anything:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.