1

A UITableView has seperator lines as shown in the following image. They do not start at the beginning of the row. See the red box in the image. I want to change where they start.

enter image description here

How can I specify where the separator lines in a table view begin?

Michael
  • 32,527
  • 49
  • 210
  • 370
  • Look at this answer: http://stackoverflow.com/questions/18365049/is-there-a-way-to-make-uitableview-cells-in-ios-7-not-have-a-line-break-in-the-s – agy Jun 13 '15 at 14:29

1 Answers1

2

Add Table View Separator Insets to Zero.

enter image description here

Add this code in cellForRowAtIndexPath:

if (cell.respondsToSelector("preservesSuperviewLayoutMargins")){
    cell.layoutMargins = UIEdgeInsetsZero
    cell.preservesSuperviewLayoutMargins = false
}

See the preview :

enter image description here

Ashish Kakkad
  • 23,586
  • 12
  • 103
  • 136