1 //无色
2 cell.selectionStyle = UITableViewCellSelectionStyleNone;
3 //蓝色,也就是系统默认的颜色
4 cell.selectionStyle = UITableViewCellSelectionStyleBlue;
5 //灰色
6 cell.selectionStyle = UITableViewCellSelectionStyleGrap;
7
8 //自定义选中的背景色 通过RGB来定义颜色
9 UIColor* color = [[UIColor alloc]initWithRed:0.0 green:0.0 blue:0.0 alpha:1];
10 cell.selectedBackgroundView = [[UIView alloc]initWithFrame:cell.frame]autorelease];
11 cell.selectedBackgroundView.backgroundColor = [UIColor redColor];
12
13 //自定义选中后的背景图片
14 cell.selectedBackgroundView = [[[UIImageView alloc]initWithImage:
[UIImage imageNamed:@"image.png"]]autorelease];
15 //设置UITableViewCell中的字体颜色时用
16 cell.textLabel.highlightedTextColor = [UIColor **color];