
UIVIEw * vIEw = [[UIVIEw alloc] initWithFrame:CGRectMake(0,200,200)];//animation 1[UIVIEw animateWithDuration:2 delay:0 options:UIVIEwAnimationoptionCurvelinear animations:^{ vIEw.frame = CGRectMake(0,100,200);} completion:^(BOol finished){ //animation 2 [UIVIEw animateWithDuration:2 delay:0 options: UIVIEwAnimationoptionRepeat |UIVIEwAnimationoptionautoreverse animations:^{ [UIVIEw setAnimationRepeatCount:1.5]; vIEw.frame = CGRectMake(50,200); } completion:^(BOol finished){ //animation 3 [UIVIEw animateWithDuration:2 delay:0 options:0 animations:^{ vIEw.frame = CGRectMake(50,200); } completion:nil]; }];}]; 什么是阻止这种动画的最佳方法?只是打电话
[vIEw.layer removeAllAnimations];
是不够的,因为它只停止当前正在执行的动画块,其余的将按顺序执行.
解决方法 您可以查询传入完成块的已完成BOol.在您调用removeAllAnimations的情况下,它将为NO. 总结以上是内存溢出为你收集整理的iphone – 停止一系列基于块的动画的最佳方法是什么全部内容,希望文章能够帮你解决iphone – 停止一系列基于块的动画的最佳方法是什么所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)