uiimageview 的替代方案 isanimating [英] alternative for uiimageview isanimating

查看:31
本文介绍了uiimageview 的替代方案 isanimating的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个代码,它在 UIImageView.isAnimating 为 false 后执行一些操作但有趣的是它永远不会出错,它总是处于 YES 状态.

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 对 iPhone 的 UIImageView 有问题"

来自此链接的人发现 IOS4.x 也有同样的错误那么任何人都可以提出任何替代方法来检查 UIImageview 是否正在设置动画?

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 ?

推荐答案

以下建议并不理想,但我认为 UIImageView 应该进行改进以成为支持动画的理想选择.无论如何,这里是:

The following suggestions are not ideal, but I guess UIImageView should undergo improvements to become ideal in supporting animations. Anyways, here goes:

  1. 您可以以与动画长度相同的间隔启动计时器,并在其到期时采取行动.(此处也建议使用此解决方案:How to use isAnimating in an iPhone app)

你可以用一个 NSTimer 来创建你的动画,它自己改变图像,完全放弃 UIImageView 的动画.这里有现成的代码:www.modejong.com/iPhone/(在 PNG 动画下).通过这种方式,您可以完全控制动画 - 您可以暂停和恢复动画,在动画结束时调用委托函数等.

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.

为了记录起见,这里问了一个类似的问题 iPhone:检测 UIImageView 图像序列动画结束的最佳方法,尽管没有迭代可能的解决方案.

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,

奥德.

附言有人知道为什么我不能将上面的链接作为简单链接发布吗?我收到抱歉,帖子不能包含该内容".留言...

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...

这篇关于uiimageview 的替代方案 isanimating的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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