ios - 如何使用 FLAnimatedImage 检查动画的结束

标签 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 何时结束。我该怎么做?

最佳答案

FLAnimatedImageView 从 1.0.9 开始有一个 loopCompletionBlock,参见 here 。添加于 https://github.com/Flipboard/FLAnimatedImage/pull/60 .

关于ios - 如何使用 FLAnimatedImage 检查动画的结束,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27578502/

相关文章:

ios - 在 UIPanGestureRecognizer 更改状态中更改 UIView 的 alpha

iphone - 删除后的核心数据在保存时抛出错误

ios - 文档提供者不一致

ios - 按下一个按钮,并使相同的按钮出现在同一页面上

swift - 在 Swift 3 中使用未解析的标识符 'LAContext'

objective-c - 取消按钮不会关闭 iOS 模拟器中的 ComposeMail 窗口

ios - 如何使用 UIPageViewController

ios - 如何使用动画以编程方式隐藏和显示 WKInterfaceGroup?

带有 UINavigationController 的 iOS 7 自定义转换

javascript - Kineticjs: Canvas 中图像的随机移动动画