Search code examples
iostableviewcell

Table View Cell Default Background Color - what sets the default colour?


When I load a TableView the default cell background color of the highlighted cell is light grey. How and where do I change this to another color?


Solution

  • Set selectionStyle for cell in method:

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    // Code to initialize your cell
        cell.selectionStyle = UITableViewCellSelectionStyleBlue;
        return cell;
    
    }