判断当前的动画已经完成,以便进行后记的动作
2011-09-10 23:51
225 查看
参考代码:
[UIView beginAnimations:@"animationID" context:nil];
[UIView setAnimationDuration:0.3];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationRepeatAutoreverses:NO];
m_image.frame = CGRectMake(0, 0, 1024, 768);
[UIView setAnimationDelegate:self];//设置动画的委托
[UIView commitAnimations];//开始动画
动画的委托并不多。
//动画结束后调用的函数
- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag
{
for(UIView *m_view in [self.view subviews])
{
if ([m_view isKindOfClass:[UIImageView class]])
{
[m_view removeFromSuperview];
}
}
}
THE END !
[UIView beginAnimations:@"animationID" context:nil];
[UIView setAnimationDuration:0.3];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationRepeatAutoreverses:NO];
m_image.frame = CGRectMake(0, 0, 1024, 768);
[UIView setAnimationDelegate:self];//设置动画的委托
[UIView commitAnimations];//开始动画
动画的委托并不多。
//动画结束后调用的函数
- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag
{
for(UIView *m_view in [self.view subviews])
{
if ([m_view isKindOfClass:[UIImageView class]])
{
[m_view removeFromSuperview];
}
}
}
THE END !
相关文章推荐
- 一般来说我们总会在设置Block之后,在合适的时间回调Block,而不希望回调Block的时候Block已经被释放了,所以我们需要对Block进行copy,copy到堆中,以便后用。 当一个Bloc
- jquery判断元素动画是否完成
- JS利用控件的默认属性判断当前控件的值是否已经改变
- WPF 学习笔记-判断动画完成的画件
- 用词库对文章进行切分,但是最后有很多分词也写在后面,怎么判断 文章 已经结束了呢?
- 判断动画状态机当前播放的动画。
- 使用AFN 进行多次循环网络请求,如何判断何时请求完成
- 如何在页面加载完成后再去做某事?什么方法可以判断当前页面加载已完成?
- 【iOS-Cocos2d游戏开发之二十二 】CCSpeed实现CCAnimate动画进行时设置慢动作以及设置游戏加减速进行(塔防游戏必备)! .
- 使用FileSystemWatcher监测大文件时,如何判断文件已经创建完成?
- 【iOS-Cocos2d游戏开发之二十二 】CCSpeed实现CCAnimate动画进行时设置慢动作以及设置游戏加减速进行(塔防游戏必备)!
- 【iOS-Cocos2d游戏开发之二十二 】CCSpeed实现CCAnimate动画进行时设置慢动作以及设置游戏加减速进行(塔防游戏必备)! .
- 【iOS-Cocos2d游戏开发之二十二 】CCSpeed实现CCAnimate动画进行时设置慢动作以及设置游戏加减速进行(塔防游戏必备)!
- css3用AnimationEnd判断动画是否完成, css3在动画完成后执行事件
- 用JS 判断图片已经加载完成(兼容IE 和 Firefox)
- JavaScript怎么判断图片是否加载完成以便获取其尺寸
- jQuery判断动画是否执行完成
- EditText判断用户输入完成,然后进行操作解决方案
- unity 判断动画是否播放完成