开发者

alternative for uiimageview isanimating

开发者 https://www.devze.com 2023-03-17 15:41 出处:网络
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开发者_Python百科.

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开发者_Python百科.

" 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 ?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消