0

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?

confile
  • 30,949
  • 47
  • 199
  • 357
  • 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

1

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,020
  • 11
  • 96
  • 132