views:

55

answers:

1

Hi all,

I have a UITableView with custom cells in it. I'd like to add a little red bar between the cells to have the cells be more distinct.

Is there an easy way to do this?

Thanks!

A: 

Use the separatorStyle and separatorColor properties of the UITableView. For example:

- (void) viewDidLoad
{
  self.tableView.separatorColor = [UIColor redColor];
  self.tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
}

That style is the default, there are some others, but depending on what OS you are targeting (the etched style is only available as of 3.2, for example).

Apple's docs on the UITableView

phooze
I saw this - is there any way to make the line thicker?
Max
Great question. I'd like to know the answer to that myself. I reckon there is, probably the best way to do this is to add a few pixel high view to the bottom of each cell, but not on the last cell in a section.Also, in the future - please add things you've already tried to your question, it'll help everyone give you more the answers you're looking for :)
phooze