1

The default separator line in table view doesn't take the width of the whole cell.. How does one specify the line separator width to take the full width of the tableview?

This is how it looks by default:

enter image description here

potato
  • 4,479
  • 7
  • 42
  • 99
  • ==> yes remove some margins for remove spacing setting of tableView c http://stackoverflow.com/questions/19499366/white-space-before-separator-line-into-my-tableview – Akash Mar 07 '16 at 16:45

1 Answers1

2

to remove all margin settings from the cell. try adding all these to the cell in

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath

    // Remove insets in UITableViewCell separator

// Remove seperator inset
if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
    cell.separatorInset = UIEdgeInsetsZero;
}

// Prevent the cell from inheriting the Table View's margin settings
if ([cell respondsToSelector:@selector(setPreservesSuperviewLayoutMargins:)]) {
    cell.preservesSuperviewLayoutMargins = NO;
}

// Explictly set cell's layout margins
if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
    cell.layoutMargins = UIEdgeInsetsZero;
}
Bhargavi
  • 515
  • 4
  • 14