UIView的动画结束 [英] UIView animation end

查看:223
本文介绍了UIView的动画结束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的UIView 动画在我的应用程序:

I am using UIView animation in my app:

        [UIView beginAnimations:nil context:NULL];
        [UIView setAnimationDuration:1];
        //do some animation
        [UIView commitAnimations];

现在,有一种可能性,即动画会需要几秒钟以完成。那么,有没有办法知道当动画已经结束?

Now, there is a possibility that the animation would take a couple of seconds to finish. So, is there a way to know when the animation has ended?

推荐答案

我没有这个使用自己还没有,但有一个方法setAnimationDidStopSelector,允许你定义一个选择当动画结束时应调用。

I haven't uses this myself yet, but there is a method setAnimationDidStopSelector that allows you to define a selector that should be called when an animation has finished.

另请参阅苹果的文档<一个href=\"http://developer.apple.com/library/ios/#documentation/uikit/reference/UIView_Class/UIView/UIView.html\"相对=nofollow> UIView的。

还有在雷Wenderlich 的一个例子网站

这篇关于UIView的动画结束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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