I am using cell.image = an animated gif file
(cell is UITableViewCell
). However, it does not animate. Is there any way I can fix it?
UIImageView
provides the necessary APIs to produce your own animations like this:
UIImage *frame1 = [UIImage imageNamed:@"frame1.png"];
UIImage *frame2 = [UIImage imageNamed:@"frame2.png"];
UIImage *frame3 = [UIImage imageNamed:@"frame3.png"];
UIImage *frame4 = [UIImage imageNamed:@"frame4.png"];
UIImageView.animationImages = [[NSArray alloc] initWithObjects:frame1, frame2, frame3, frame4, nil];
UIImageView.animationDuration = 1.0 //defaults is number of animation images * 1/30th of a second
UIImageView.animationRepeatCount = 5; //default is 0, which repeats indefinitely
[UIImageView startAnimating];
//[uiImageView stopAnimating];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With