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?
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.
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
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