alternative for uiimageview isanimating

谁说胖子不能爱 提交于 2019-12-12 17:15:24

问题


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 ?


回答1:


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

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

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



来源:https://stackoverflow.com/questions/6583304/alternative-for-uiimageview-isanimating

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!