简体   繁体   English

UIView Animate不尊重延迟吗?

[英]UIView Animate Doesn't Respect Delay?

Why does this not work? 为什么这不起作用?

[UIView animateWithDuration:0 delay:3 options:0 animations:^(void) { 
    NSLog(@"after duration, please!");
}  completion:nil];

The NSLog fires immediately. NSLog立即触发。

I'm not looking for workarounds (there are many), but rather wondering why this would be. 我不是在寻找解决方法(有很多方法),而是想知道为什么会这样。

The intermediate frames of core animation are actually happening in another background thread. 核心动画的中间帧实际上发生在另一个后台线程中。 The first and last frame of the animation are often created immediately. 动画的第一帧和最后一帧通常会立即创建。 So the NSLog can fire in the main UI thread without waiting or even knowing about any background animation in progress. 因此,NSLog可以在主UI线程中触发,而无需等待甚至不知道正在进行的任何背景动画。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM