对基于UIView块的动画重复计数 [英] Repeat count for UIView block-based animation

查看:92
本文介绍了对基于UIView块的动画重复计数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看过基于块的动画的方法,并注意到 [UIView setAnimationRepeatCount:] 没有等效的参数或选项。

I've looked at the methods for block based animation and noticed there is no equivalent parameter or option for [UIView setAnimationRepeatCount:].

重复动画一个固定次数的最简单的方法是什么?例如,使用完成块链接它们?

What's the simplest way to repeat an animation a fixed number of times? Do you, for instance, chain them using the completion block?

推荐答案

设置完成回调 - 重新启动动画 - 并自己跟踪柜台。

Set a completion callback - re-initiate the animation in it - and keep track of the counter yourself.

这篇关于对基于UIView块的动画重复计数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆