В cellForRowAtIndexPath
Я добавляю UIImageView
к cell.contentView
. Проблема в том, что когда ячейка прокручивается за пределы экрана и снова включается, она снова добавляет то же изображение поверх уже существующего. Это происходит непрерывно, пока я не получу очень сложное размытое изображение.
Вам нужно продолжать удалять какие-либо изображения, которые вы добавляете в cell.contentView
? Если да, то в каком методе делегата вы это делаете?
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"CellIdentifier";
MyTableCell *cell = (MyTableCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"MyTableCell" owner:self options:nil];
cell = [nib objectAtIndex:0];
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"image.jpg"]];
imageView.center = CGPointMake(310, 48);
[cell.contentView addSubview:imageView];
[imageView release];
return cell;
}