How to customize tableView separator in iPhone
If you want to do more than change the color of the separator using the separatorColor property of the UITableView then you could set the separatorStyle property to UITableViewCellSeparatorStyleNone and then either:
- create custom UITableViewCells that include your custom seperator within them
- create alternate [UITableViewCell][6]s that include your custom separator
For example, if your table currently displays 5 rows you could update it to display 9 rows and the rows at index 1, 3, 5, 7 would be separator cells.
A better solution is to use the cell's current width and height. Something like this:
UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(0, cell.contentView.frame.size.height - 1.0, cell.contentView.frame.size.width, 1)];
lineView.backgroundColor = [UIColor darkGrayColor];
[cell.contentView addSubview:lineView];