我正在尝试对三个 UILabel(display1、display2、display3)进行交叉溶解,方法是使用 block 动画淡出、更改文本,然后一次淡入一个。我使用的代码是:
[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];
}];
我收到以下警告:
Method '+animateWithDuration:delay:animations:completion:' not found*
和
'UIView' may not respond to method '+animateWithDuration:delay:animations:completion:'
我使用的是 Xcode 4.0,iOS 构建目标为 4.3。
最佳答案
您想使用
+ animateWithDuration:delay:options:animations:completion:
相反。请注意中间的选项:
。
关于ios - animateWithDuration 无法识别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6729085/