加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

iphone – 如何获取动画结束通知

发布时间:2020-12-14 18:57:35 所属栏目:百科 来源:网络整理
导读:动画结束后,我想做一些动作. [UIView beginAnimations:nil context:NULL];[UIView setAnimationDuration:0.80f];self.view.transform = CGAffineTransformMakeTranslation( self.view.frame.origin.x,480.0f + (self.view.frame.size.height/2) // move the
动画结束后,我想做一些动作.

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.80f];
self.view.transform = 
CGAffineTransformMakeTranslation(
                                 self.view.frame.origin.x,480.0f + (self.view.frame.size.height/2)  // move the whole view offscreen
                                 );
[self.view setAlpha:0];
[UIView commitAnimations];

我已经完成了上面的动画,如何找到动画结束,以便我可以在那之后做我的动作.

解决方法

用这个:

[UIView animateWithDuration:0.80f animations:^{
    self.view.transform =
    CGAffineTransformMakeTranslation(
                                     self.view.frame.origin.x,480.0f + (self.view.frame.size.height/2)  // move the whole view offscreen
                                     );
    [self.view setAlpha:0];
    }
    completion:^(BOOL finished){
        // your code
    }];

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读