Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add animated Gif image in Iphone UIImageView

I need to load an animated Gif image from a URL in UIImageview.

When I used the normal code, the image didn't load.

Is there any other way to load animated Gif images?

like image 388
Velmurugan Avatar asked Dec 08 '10 10:12

Velmurugan


People also ask

How do I download an animated GIF to my iPhone?

Open the message that has the previously sent GIF that you want to save. Tap and hold the GIF, then tap Save. If you have an iPhone 6s or later, you can use 3D Touch to save a GIF. Just press deeply on the GIF, swipe up and tap Save.


1 Answers

UIImageView* animatedImageView = [[UIImageView alloc] initWithFrame:self.view.bounds]; animatedImageView.animationImages = [NSArray arrayWithObjects:                                    [UIImage imageNamed:@"image1.gif"],                                [UIImage imageNamed:@"image2.gif"],                                [UIImage imageNamed:@"image3.gif"],                                [UIImage imageNamed:@"image4.gif"], nil]; animatedImageView.animationDuration = 1.0f; animatedImageView.animationRepeatCount = 0; [animatedImageView startAnimating]; [self.view addSubview: animatedImageView]; 

You can load more than one gif images.

You can split your gif using the following ImageMagick command:

convert +adjoin loading.gif out%d.gif 
like image 116
Ishu Avatar answered Sep 30 '22 02:09

Ishu