当cell.accessoryType = UITableViewCellAccessoryCheckmark;
设置√的颜色
cell.tintColor = [[UIColor alloc]initWithRed:151/255.0 green:196/255.0 blue:68/255.0 alpha:1];
设置tableview背景
UIImageView *backImageView=[[UIImageView alloc]initWithFrame:self.tableView.bounds];
[backImageViewsetImage:[UIImageimageNamed:@"bg"]];
self.tableView.backgroundView=backImageView;
设置点击cell时高亮的颜色
UIColor*color = [[UIColoralloc]initWithRed:151/255.0 green:196/255.0blue:68/255.0alpha:0.3];
//通过RGB来定义自己的颜色
cell.selectedBackgroundView = [[UIView alloc]initWithFrame:cell.frame];
cell.selectedBackgroundView.backgroundColor = color;
cell文本颜色颜色
cell.textLabel.textColor = [UIColor whiteColor];
cell.detailTextLabel.textColor = [UIColor whiteColor];
取消cell的点击时高亮状态
cell.selectionStyle = UITableViewCellSelectionStyleNone;
取消cell选中状态- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ // 取消选中状态
[tableView deselectRowAtIndexPath:indexPath animated:NO];
}
网友评论