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

iphone – 完成动画后想要调用一些方法

发布时间:2020-12-14 19:52:35 所属栏目:百科 来源:网络整理
导读:在我的iPhone应用程序中 我正在做某些动画. ?喜欢 [UIView beginAnimations:@"stalk" context:nil]; [UIView setAnimationDuration:1]; [UIView setAnimationBeginsFromCurrentState:YES]; self.frame=originalSelf; [UIView commitAnimations]; 完成这个动
在我的iPhone应用程序中

我正在做某些动画.
?喜欢

[UIView beginAnimations:@"stalk" context:nil];
    [UIView setAnimationDuration:1];
    [UIView setAnimationBeginsFromCurrentState:YES];
    self.frame=originalSelf;
    [UIView commitAnimations];

完成这个动画后我想要调用一些方法……

我知道一些阻止动画或

DidStopAnimation通知

我怎么做….
谢谢..

解决方法

在iOS 4及更高版本中,建议使用块来实现此目的:

[UIView animateWithDuration:1 
                     animations:^{
                         self.frame=originalSelf;} 
                     completion:^(BOOL finished){

                        //My method call;
                     }
     ];

(编辑:李大同)

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

    推荐文章
      热点阅读