gpt4 book ai didi

ios - 动画持续时间 :delay:options:animations:completion: blocking UI when used with UIViewAnimationOptionRepeat | UIViewAnimationOptionAutoreverse

转载 作者:技术小花猫 更新时间:2023-10-29 11:19:46 26 4
gpt4 key购买 nike

我正在运行一个函数来脉冲播放图标:

- (void)pulsePlayIcon {
if ([self isPlaying]) {
return;
}

[[self videoView] playIcon].hidden = NO;
[[self videoView] playIcon].alpha = 1.0;

[UIView animateWithDuration:[self playIconPulseDuration]
delay:[self playIconPulseTimeInterval]
options:(UIViewAnimationOptionRepeat | UIViewAnimationOptionAutoreverse)
animations:^{
[[self videoView] playIcon].alpha = 0.8;
}
completion:^(BOOL completed) {}];
}

这在 iOS 5.0 中运行良好,但在 4.3 中它会阻塞 UI。用户界面没有响应。我读到这是在 iOS 4.0 或更高版本 (>= 4.0) 中执行重复动画的建议方法。罪魁祸首似乎是 UIViewAnimationOptionRepeat。你看到我犯了什么明显的错误吗?

最佳答案

您可能还应该包括 UIViewAnimationOptionAllowUserInteraction

关于ios - 动画持续时间 :delay:options:animations:completion: blocking UI when used with UIViewAnimationOptionRepeat | UIViewAnimationOptionAutoreverse,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8992273/

26 4 0