UITableView Tips

1.cell选中时,去掉选中的灰色背景

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
}

或者直接让灰色背景不显示

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    ......
    // Configure the cell...
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}

2.取消cell之间的分隔线

self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;

默认是UITableViewCellSeparatorStyleSingleLine

你可能感兴趣的:(UITableView Tips)