remove image from tableViewCell created programatically
Posted
by Ruthy
on Stack Overflow
See other posts from Stack Overflow
or by Ruthy
Published on 2010-04-11T15:33:57Z
Indexed on
2010/04/11
15:43 UTC
Read the original article
Hit count: 254
Hello, I would like to move an imageView contained on a cell and it works but creating a new image at new position keeping old image (then two are shown). How could I remove old one?? used code:
UIImage *cellImage = [UIImage imageNamed:(@"%@", showIconName)]; UIImageView *imageViewToPutInCell = [[UIImageView alloc] initWithImage:cellImage]; imageViewToPutInCell.frame = CGRectMake(iconPos, 7, cellImage.size.width, cellImage.size.height); [cell.contentView addSubview:imageViewToPutInCell];
every time that I reload tableView, it creates a new overlapped image.
[cell.contentView removeFromSuperview]; used before, removes it but then new image is not created. Please help!! Thanx
© Stack Overflow or respective owner