我试图在我的UITableViewCell子类上添加一个连续的动画。 这是一个相当简单的一与图像淡入淡出(0.4α和1.0之间的衰落), 我到目前为止已经试过IST以下:UITableViewCell中的连续动画
-(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崩溃或多或少eternaly :)
我对每样的建议非常感激,TIPP或诀窍如何处理这一点。
在此先感谢,
SAM
我回答之前的快速问题,iOS3兼容性是强制性的吗? – 2010-10-06 13:47:44
不是真的,我只是在运行低于4.1或4.0的设备上忽略动画 – samsam 2010-10-06 13:51:41