uiimageview isanimating 的替代方案
我有一个代码在 UIImageView.isAnimating 为 false 后执行一些操作 但有趣的是它永远不会出错,它总是处于“是”状态。
“iPhone 版 UIImageView 的 isAnimating 返回错误”
来自此链接看到与 IOS4.x 相同的错误 那么有人可以建议任何替代方法来检查 UIImageview 是否有动画吗?
i have a code which does some actions after UIImageView.isAnimating is false
but funny part is it never goes false its always in YES state.
" isAnimating return is faulty for UIImageView for iPhone "
people from this link see the same fault with IOS4.x
so can anyone please suggest any alternative to check whetheror not UIImageview is animating ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
以下建议并不理想,但我认为 UIImageView 应该经过改进才能成为支持动画的理想选择。无论如何,这里是:
您可以以与动画长度相同的间隔启动计时器,并在其到期时采取行动。 (此处还建议使用此解决方案:如何在 iPhone 应用程序中使用 isAnimating )
您可以使用 NSTimer 创建动画,它会自行更改图像,完全放弃 UIImageView 的动画。这里有现成的代码:
www.modejong.com/iPhone/(PNG 动画下)。这样你就可以完全控制动画 - 你可以暂停和恢复它,在动画结束时调用委托函数等。
为了记录起见,这里提出了类似的问题 iPhone:检测 UIImageView 图像序列动画结束的最佳方法,尽管可能解决方案不是迭代。
GL,
奥德。
ps 有人知道为什么我不能将上面的链接发布为简单链接吗?我收到一条“抱歉,帖子不能包含该内容。”信息...
The following suggestions are not ideal, but I guess UIImageView should undergo improvements to become ideal in supporting animations. Anyways, here goes:
You can start a timer with the same interval as the animation length, and act on its expiry. (This solution is also suggested here: How to use isAnimating in an iPhone app)
You can create your animation with an NSTimer that changes the images by itself, completely abandoning UIImageView's animation. There's ready-made code for that here:
www.modejong.com/iPhone/ (under PNG Animation). This way you have total control over the animation - you can pause and resume it, call a delegate function on animation end, etc.
And for records sake, a similar question was asked here iPhone : Best way to detect the end of UIImageView image sequence animation, although possible solutions were not iterated.
GL,
Oded.
p.s. Anyone know why I can't post the link above as a simple link? I get a "Sorry, posts can't contain that content." message...