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

标签 ios ios5 core-animation ios4

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

- (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/

相关文章:

ios - 保存 Promise 履行和拒绝 PromiseKit

ios - iPhone购物应用程序中的Apple Tax?

ios - 在 SwiftUI 中平滑更改 View 位置

iOS : WebView Background color to transparent

ios - iOS5 中 icloud 的核心数据

iphone - 自定义字体在 iPhone 设备上不起作用

Cocoa - 核心动画 - 如何停止代理动画?

iphone - iOS图标抖动算法

iPhone SDK : Block Animation Ignore Error with Curved Path

ios - 链接 EQ 时推荐的 AUGraph 顺序