tableView.allowsSelection = NO;//禁止cell選中
cell.userInteractionEnabled = NO;//這個設(shè)置后cell不可點(diǎn)擊,cell里邊的控件不可點(diǎn)擊。
cell.contentView.userInteractionEnabled =NO;//這個設(shè)置后cell可以點(diǎn)擊,但cell里邊的控件不可點(diǎn)擊。
cell.selectionStyle = UITableViewCellSelectionStyleNone; //這個設(shè)置后cell可以點(diǎn)擊,點(diǎn)擊后沒有顏色
設(shè)置cell的選中后背景顏色
cell.selectedBackgroundView= [[UIViewalloc]initWithFrame:cell.frame];
cell.selectedBackgroundView.backgroundColor= [UIColorredColor];