LK.*_*LK. 8 iphone ipad uiviewanimation objective-c-blocks
我有以下动画块:
[UIView animateWithDuration:2
animations:^{
[childViewController_.view setAlpha:0];
}
completion:^(BOOL finished) {
[childViewController_.view removeFromSuperview];
}];
Run Code Online (Sandbox Code Playgroud)
当如上执行时,立即调用完成块.但是,如果我没有完成块,则按预期执行动画.
我在这做错了什么?
更新完成块中
的finished标志是NO.
您只是忘记检查一个条件
[UIView animateWithDuration:2
animations:^{
[childViewController_.view setAlpha:0];
}
completion:^(BOOL finished) {
if (finished)
{
[childViewController_.view removeFromSuperview];
}
}];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3302 次 |
| 最近记录: |