先上图给看看效果
cell单选逻辑就是取出上一个选中的cell 设置图片为默认图片 在取出点击的cell 设置图片为选中图片即可
废话不多说直接上代码
p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Menlo; color: #000000 }
p.p2 { margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Menlo; color: #000000; min-height: 15.0px }
p.p3 { margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Menlo; color: #008400 }
p.p4 { margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Menlo; color: #d12f1b }
span.s1 { }
span.s2 { color: #ba2da2 }
span.s3 { color: #703daa }
span.s4 { color: #000000 }
span.s5 { color: #3e1e81 }
span.s6 { color: #4f8187 }
span.s7 { color: #d12f1b }
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
// [tableView deselectRowAtIndexPath:indexPath animated:YES];
NSIndexPath * indexold = [NSIndexPath indexPathForRow:self.oldIndex inSection:self.oldSectionIndex];
HBAutoReplyCell * cell = [tableView cellForRowAtIndexPath:indexold];
cell.checkImageView.image = [UIImage imageNamed:@"CQweixuanzhong.png"];
HBAutoReplyCell * cell2 = [tableView cellForRowAtIndexPath:indexPath];
cell2.checkImageView.image = [UIImage imageNamed:@"CQxuanzhong.png"];
self.oldSectionIndex = indexPath.section;
self.oldIndex = indexPath.row;
}