我試圖在我的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