33

I've read (and used) the code here which illustrates how to change the background color and border color of a UITableViewCell in grouped mode on the iPhone. I'm writing an app now which has a non-grouped UITableView and I need to change the border color of the cells. I know that I can modify the code and create a new background view and apply it, but is it necessary?

Is there an easy way to specify the border color of a UITableViewCell if it is a non-grouped style?

Community
  • 1
  • 1
marcc
  • 12,295
  • 7
  • 49
  • 59

1 Answers1

112

If by "border color" in a plain table view you mean the separator lines between the cells (default color gray), you can customize this color for the whole table view via:

tableView.separatorColor = [UIColor blueColor];

See the UITableView reference.

Pang
  • 9,564
  • 146
  • 81
  • 122
Daniel Rinser
  • 8,855
  • 4
  • 41
  • 39