我有一个使用 UITableViewCellStyleDefault 样式的 UITableView。我还设置了细节配件:
cell.accessoryType= UITableViewCellAccessoryDetailDisclosureButton;
我希望代码能够在推送详细附件时生成委托(delegate)方法accessoryButtonTappedForRowWithIndexPath:,该特定单元格的图像将更改为另一个图像。
我怎样才能做到这一点?我需要以某种方式重新创建单元格吗?
谢谢!
最佳答案
不,您只需将其他图像添加到单元格的 ImageView 中即可
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
cell.imageView.image = [UIImage imageNamed:@"IMAGENAME"];
关于iphone - 更改 UITableViewCell 的图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10072522/