當(dāng)前cell的自定義背景顏色
BMMineTableViewCell *cell = [_tableView dequeueReusableCellWithIdentifier: BMMineTVCellIdentifier];
cell.selectedBackgroundView = [[UIView alloc] initWithFrame:cell.frame];
cell.selectedBackgroundView.backgroundColor = BMColor(@"#f0f5f7");
return cell;
Cell點(diǎn)擊后選中的顏色消失
//cell點(diǎn)擊硼补,在代理方法中寫
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
//點(diǎn)擊后cell的選中顏色消失
[self performSelector:@selector(delectCellColor:) withObject:nil afterDelay:0.5];
}
//cell的選中顏色消失
- (void)delectCellColor:(id)sender{
[self.tableView deselectRowAtIndexPath:[self.tableView indexPathForSelectedRow] animated:YES]