【发布时间】:2010-10-06 13:43:03
【问题描述】:
我正在尝试将连续动画添加到我的 UITableViewCell-Subclass。 这是一个相当简单的图像淡入淡出(在 0.4 alpha 和 1.0 之间淡入), 到目前为止,我尝试过的内容如下:
-(void)animateRecordingIndicator{
[UIView beginAnimations:@"RecordingIndicatorAnimation" context:nil];
[UIView setAnimationDuration:0.3];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(animationFinished)];
if (animatedImageView.alpha == 0.4)
animatedImageView.alpha = 1.0;
else
animatedImageView.alpha = 0.4;
[UIView commitAnimations];
}
animationFinished里面的代码如下:
-(void)animationFinished{
if (doShowAnimation) {
[self performSelectorOnMainThread:@selector(animateRecordingIndicator) withObject:nil waitUntilDone:YES];
}
}
我的期望现在应该很清楚了,但我得到的只是 Xcode 或多或少地永远加载 Stackframes 的崩溃:)
【问题讨论】:
-
我回答之前的快速问题,iOS3 兼容性是强制性的吗?
-
不是真的,我只是忽略了运行低于 4.1 或 4.0 的设备上的动画
标签: ios uitableview animation