首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >尝试使用animateWithDuration时找不到方法'+animateWithDuration:delay:options:animations:‘

尝试使用animateWithDuration时找不到方法'+animateWithDuration:delay:options:animations:‘
EN

Stack Overflow用户
提问于 2011-09-03 05:37:59
回答 1查看 1.7K关注 0票数 3
代码语言:javascript
复制
-(void)fadeLabel{

    UILabel *label = (UILabel *)[self.view viewWithTag:kLabelTag];


    [UIView animateWithDuration:2.0
                          delay:0.0
                        options:UIViewAnimationCurveEaseIn
                     animations:^{

                         label.alpha = 0.0;


                     }];



}

我第一次尝试动画效果的结果是:在尝试使用animateWithDuration时找不到方法'+animateWithDuration:delay:options:animations:‘

我不知道是什么导致了这个错误,但是我的代码和所有其他教程和指南是一样的。

谢谢!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-09-03 05:42:40

该方法实际上是+animateWithDuration:delay:options:animations:completion:。你错过了completion:的部分。如果不需要补全块,可以只将nil传递给该参数。

票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7289473

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档