iPhone 的 UIImageView 的 isAnimating 返回错误 [英] isAnimating return is faulty for UIImageView for iPhone

查看:12
本文介绍了iPhone 的 UIImageView 的 isAnimating 返回错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现 isAnimating 在完成最大循环数并停止动画后仍返回 true.但是一旦你移动 UIImageView,它会突然更新并变为 false.

I am finding that isAnimating is returning true even after it has completed the max # of loops and stopped animating. However once you move the UIImageView, it will suddenly update and change to false.

以下是我的代码的重要部分:我以标准方式设置动画:

Here are the important bits of my code: I set up the animation in the standard way:

UIImageView* newImageView = ...
newImageView.animationImages = imageArray;
newImageView.animationDuration = 1.0;
newImageView.animationRepeatCount = 1;
...
[newImagView startAnimating];

在代码的其他地方,我正在检查动画是否已经完成:

Elsewhere in the code I am checking whether the animation has come to completion with:

if (not [newImageView isAnimating])
{
...
}

动画停止几秒后,isAnimating 仍会返回 true.

Seconds after the animation has stopped, isAnimating will still return true.

但是,如果 newImageView 已经以某种方式更新(在我的情况下是移动它),它会突然返回 false.这似乎无关,并指出这是一个错误.

However if the newImageView has been updated in some way (in my case moving it), it will suddenly return false. Which seems unrelated, and points towards this being a bug.

有没有人遇到过这种情况或知道解决方法?

Has anyone run into this or know a work around?

推荐答案

我在 iphone 4.1 SDK 上进行了编译测试,并在 3.1.x 设备上运行.

I tested it compiling with iphone 4.1 SDK and runngin thaton a 3.1.x device.

isAnimating 在设备上有效,但不适用于任何 iphone simualtor 3.2,4.0,4,1

isAnimating on device works but not with any iphone simualtor 3.2,4.0,4,1

这篇关于iPhone 的 UIImageView 的 isAnimating 返回错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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