How to change a cell's selection colour

By default, when you touch a cell in a UITableView, it lights up bright blue. You can use this property to change the cell’s selection style in the cellForRowAtIndexPath method:

cell.selectionStyle = UITableViewCellSelectionStyleGray;

Possible values are

  • UITableViewCellSelectionStyleGray
  • UITableViewCellSelectionStyleBlue (the default)
  • UITableViewCellSelectionStyleNone

Alternatively you can select the cell in Interface Builder and pick these values from the drop down menu:

Screen Shot 2013-01-11 at 01.05.19





Leave a Reply