如何使用FLAnimatedImage检查动画结束

时间:2014-12-20 08:34:36

标签: ios xcode animation gif animated-gif

如何使用FLAnimatedImage检查动画结束? 我有这段代码:

@property (weak, nonatomic) IBOutlet FLAnimatedImageView *animatedImageView;

NSURL *url1 = [[NSBundle mainBundle] URLForResource:@"hand" withExtension:@"gif"];
    NSData *data1 = [NSData dataWithContentsOfURL:url1];
    FLAnimatedImage *animatedImage1 = [FLAnimatedImage animatedImageWithGIFData:data1];
    self.animatedImageView.animatedImage = animatedImage1;
    self.animatedImageView.contentMode = UIViewContentModeScaleAspectFit;

我想检测动画gif何时结束。我怎么能这样做?

1 个答案:

答案 0 :(得分:1)

FLAnimatedImageView自1.0.9起有loopCompletionBlock,请参阅here。已添加到https://github.com/Flipboard/FLAnimatedImage/pull/60