当我单击一个单元格时,我正在尝试更改图像,但它不起作用
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [feedsTableView cellForRowAtIndexPath:indexPath];
UILabel *title = (UILabel *)[cell.contentView viewWithTag:0011];
UIImage *image = (UIImage *)[cell.contentView viewWithTag:0017];
image = [UIImage imageNamed:@"reload.png"];
title.text = @"test";
cellClicked = YES;
[feedsTableView beginUpdates];
[feedsTableView endUpdates];
[feedsTableView deselectRowAtIndexPath:indexPath animated:YES];
}
然而,标题发生了变化。
我的图像如何添加到表格中。
CGRect imageFrame = CGRectMake(0, 0, 120, 90);
customImage.tag = 0017;
self.customImage = [[UIImageView alloc] initWithFrame:imageFrame];
[cell.contentView addSubview:self.customImage];