我在UITableViewCell中有一个UIImageView。 UIImageView动画。出于某种奇怪的原因,当细胞离开视野时,动画停止。 UIImageView永远不会再被初始化,并且UIImageView永远不会被明确地告知 - (void)stopAnimating;所以我不确定它为什么停止。UIImageView动画在UITableView中停止
以下是我的cellforRowAtIndexPath的有趣部分:。正如你可以
cell = (BOAudioCell *)[tableView dequeueReusableCellWithIdentifier:AudioCellIdentifier];
if (!cell) {
cell = [[[BOAudioCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:AudioCellIdentifier] autorelease];
BOPlayControl *playControl = [(BOAudioCell *)cell playControl];
[[playControl playbackButton] addTarget:self action:@selector(playbackButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
}
int index = [indexPath row];
BOModel *model = [models objectAtIndex:index];
[[(BOAudioCell *)cell titleLabel] setText:[model title]];
[[(BOAudioCell *)cell favoriteButton] addTarget:self action:@selector(favoriteButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
正如你所知道的,我没有设置相应的动画开始点小区,因为没有一个内置在一个UIImageView方式。
通过“视图外”,你的意思是当UITableViewCell滚动屏幕? – 2010-02-17 14:53:49
你可以发布你的tableView:cellForRowAtIndexPath:方法吗? – 2010-02-17 14:56:38
当我说“离开视图”时,我指的是UITableViewCell何时位于UITableView的可见区域之外。 – 2010-02-17 15:04:22