【发布时间】:2012-01-24 18:45:27
【问题描述】:
我正在运行一个函数来脉冲播放图标:
- (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。你看到我犯了什么明显的错误吗?
【问题讨论】:
-
我刚刚遇到了同样的问题。直到今天我才在 iOS 4.3 上进行测试。出于某种原因,iOS 5 及更高版本的 UIViewAnimationOptionAllowUserInteraction 似乎设置为 true。
标签: ios ios5 core-animation ios4