1

I have created a custom UITableViewCell class with a xib file.

In the cell xib, I have set the table view cell's separator to be "Custom Insets" with left=0, right=0: enter image description here

But when I run my app, it still shows bottom line as below: enter image description here

How to remove the separator line in interface builder of xib file? If it is not possible, what would be the progrmattical way? (do it in interface builder is my preference by the way)

Leem.fin
  • 40,781
  • 83
  • 202
  • 354

4 Answers4

3

Set Separator Style of your UITableView to none

Or, programmatically

Swift 3+

tableView.separatorStyle = .none

Objective-C

tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
Vlad Khambir
  • 4,313
  • 1
  • 17
  • 25
mag_zbc
  • 6,801
  • 14
  • 40
  • 62
  • Like I mentioned in my question, I prefer do it in storyboard. I know your answer works. But @Kerberos' points me to the direction I prefer. Thanks anyway. – Leem.fin Sep 28 '17 at 10:32
3

You must remove the separator line in the Attributes inspector of the tableview like in the image below:

enter image description here

Kerberos
  • 4,036
  • 3
  • 36
  • 55
1

To remove extra saparator line from your UITableView you need to set tableFooterView of UITableView

tableView.tableFooterView = UIView()
Crazy Developer
  • 3,464
  • 3
  • 28
  • 62
0

It seems that you are using an old version of Xcode.If you want to remove separator line, you have to select default option form separator inset and select none from the separator.

Follow this image

Or else, you can also set by programmatically

Swift 3+

yourTableView.separatorStyle = .none
VishalPethani
  • 854
  • 1
  • 9
  • 17