Animate an ImageView

Send Snippet To: Save this snippet to Code Collector Pro -- view all balzan's snippets
language: Objective-C
license: Other

Code for Snippet:

NSArray *images = @[  [UIImage imageNamed:@"image.png"], [UIImage imageNamed:@"image2.png"], [UIImage imageNamed:@"image3.png"], [UIImage imageNamed:@"image4.gif"],];
UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 320, 200)];
imageView.animationImages = images;
imageView.animationDuration = 1;
imageView.animationRepeatCount = 0; // 0 = nonStop repeat
[imageView startAnimating];
[self.view addSubview:imageView];
comments powered by Disqus


Link to this snippet:

Download to Code Collector

To use the direct link to your snippet on either copy the html from the above section or drag the Download to Code Collector to where you would like to use it.

More Info:

Times Viewed: 347
Date Added: 2013-05-09 00:52:56
Last Modified: 2014-02-18 20:29:31

Web Analytics