方法一:
//解决侧拉栏重用问题关键 (每次重绘cell时 移除旧的)
// [[cell.contentView subviews] makeObjectsPerformSelector:@selector(removeFromSuperview) withObject:nil];
方法二:
//换成这句防止cell的重用
NSString *cellIdentifier = [NSString stringWithFormat:@"%ld_%ld", (long)indexPath.section, (long)indexPath.row];
方法三:
将控件置空
例如:
cell.typeLabel1.text = nil;
cell.typeLabel1.layer.backgroundColor = nil;
cell.typeLabel1.layer.borderColor = nil;
cell.typeLabel1.layer.borderWidth = 0;
cell.contentLabel1 =nil;
cell.lineView.backgroundColor = nil;
cell.citylabel1.text = nil;
cell.areaLabel1.text = nil;
[cell.commentBtu1 setBackgroundImage:nil forState:UIControlStateNormal];
[cell.likeBtu1 setBackgroundImage:nil forState:UIControlStateNormal];