我知道您可以像这样使用 block 执行两阶段动画:
[UIView animateWithDuration:25.0 delay:0.0 options:UIViewAnimationCurveLinear animations:
^{
aView.alpha = 2.5;
}
completion:^(BOOL finished)
{
aView.hidden = YES;
}
];
..但是我如何使用 block 创建多阶段(超过 2 个)动画?
最佳答案
使用嵌套动画:
[UIView animateWithDuration:0.5
delay:0.0
options:UIViewAnimationOptionBeginFromCurrentState
animations:^{
//first animation
}
completion:^(BOOL finished){[UIView animateWithDuration:0.5
delay:0.0
options:UIViewAnimationOptionBeginFromCurrentState
animations:^{
//second animation
}
completion:^(BOOL finished){//and so on..
}];}];
关于objective-c - 使用 block 的多级动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7008838/