1

i have one gif image file having 4 images , i like to display these images in UIImage view one by one line image.animation . please guide is it possible to display or shoul i use alternat tell me .

thank you .

Youaregreat
  • 79
  • 1
  • 1
  • 11

5 Answers5

3

FLAnimatedImage is a performant open source animated GIF engine for iOS:

  • Plays multiple GIFs simultaneously with a playback speed comparable to desktop browsers
  • Honors variable frame delays
  • Behaves gracefully under memory pressure
  • Eliminates delays or blocking during the first playback loop
  • Interprets the frame delays of fast GIFs the same way modern browsers do

It's a well-tested component that I wrote to power all GIFs in Flipboard.

Raphael Schaad
  • 1,659
  • 1
  • 17
  • 17
1

it will help you , for gif link..https://github.com/mayoff/uiimage-from-animated-gif more help please feel free to ask

Jayachandra A
  • 1,335
  • 1
  • 10
  • 21
0

yes it possible in iOS,here i enclosed one URL below.please refer this for your concept,even i did it with help of this link.

https://github.com/mayoff/uiimage-from-animated-gif

hope i held you.

dhaya
  • 1,522
  • 13
  • 21
0

Try like this...

- (void)viewDidLoad {
        [super viewDidLoad];

        NSURL *url = [[NSBundle mainBundle] URLForResource:@"loading" withExtension:@"gif"];
        UIImage *loadingImage = [UIImage animatedImageWithAnimatedGIFData:[NSData dataWithContentsOfURL:url]];
        self.dataImageView.animationImages = loadingImage.images;
        self.dataImageView.animationDuration = loadingImage.duration;
        self.dataImageView.animationRepeatCount = 1;
        self.dataImageView.image = loadingImage.images.lastObject;
        [self.dataImageView startAnimating];
    }
iosLearner
  • 1,312
  • 1
  • 16
  • 30
0

First of all you can add those 4 images in one Plist and do the following code. I hope it will work

    NSDictionary *picturesDictionary = [NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"PhotesArray" ofType:@"plist"]];
NSArray *imageNames = [picturesDictionary objectForKey:@"Photos"];
NSMutableArray *images = [[NSMutableArray alloc] init];
for (int i=0; i<[imageNames count]; i++) {
    [images addObject:[UIImage imageNamed:[imageNames objectAtIndex:i]]];
}
//Normal animation
self.dataImageView.animationImages = images;
self.dataImageView.animationDuration = 3.0;
[self.dataImageView startAnimating];
Mannam Brahmam
  • 2,225
  • 2
  • 24
  • 36