首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >是否无法识别animateWithDuration?

是否无法识别animateWithDuration?
EN

Stack Overflow用户
提问于 2011-07-18 13:54:19
回答 1查看 1.7K关注 0票数 0

我试图在三个UILabels (display1,display2,display3)上做一个交叉融合,使用块动画淡出,更改文本,然后一次淡入一个。我使用的代码是:

代码语言:javascript
复制
[UIView animateWithDuration:1.0 delay: 1.0
    animations:^{
        display1.alpha = 0.0;
        display2.alpha = 0.0;
        display3.alpha = 0.0;
    }
    completion:^{
        [display1 setText:[NSString stringWithFormat:@"%@",[engine getstring]]];
        [display2 setText:[NSString stringWithFormat:@"%@",[engine getstring]]];
        [display3 setText:[NSString stringWithFormat:@"%@",[engine getstring]]];
        [UIView animateWithDuration:1.0 delay:1.0
            animations:^{
                display1.alpha = 1.0;
                [UIView animateWithDuration:1.0 delay:1.0
                    animations:^{
                        display2.alpha = 1.0;
                        [UIView animateWithDuration:1.0
                            delay:1.0
                            animations:^{
                                display3.alpha = 1.0;
                            } completion:nil];
                    } completion:nil];
        } completion:nil];
    }];

我收到以下警告:

代码语言:javascript
复制
Method '+animateWithDuration:delay:animations:completion:' not found*

代码语言:javascript
复制
'UIView' may not respond to method '+animateWithDuration:delay:animations:completion:'

我使用的是Xcode4.0,iOS构建目标是4.3。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-07-18 13:59:34

您想要使用

代码语言:javascript
复制
+ animateWithDuration:delay:options:animations:completion:

而不是。请注意中间的options:

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

https://stackoverflow.com/questions/6729085

复制
相关文章

相似问题

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