Cell的点击效果(点击时才有高亮松开则消失)
在celldidselect方法中实现
[tableView deselectRowAtIndexPath:indexPath animated:YES];
设置点击的背景颜色
系统默认的三种颜色样式
//无色
cell.selectionStyle = UITableViewCellSelectionStyleNone;
//蓝色
cell.selectionStyle = UITableViewCellSelectionStyleBlue;
//灰色
cell.selectionStyle = UITableViewCellSelectionStyleGray;
//自定义的颜色
/**
* 修改cell的控件属性
* 此方法中可以修改系统默认cell的各个属性
*/
//-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath实现
cell.selectedBackgroundView = [[UIView alloc] initWithFrame:cell.frame]; //这行代码不能省略
cell.selectedBackgroundView.backgroundColor = [UIColor xxxxxx];