Evgeniy Kleban Evgeniy Kleban - 1 year ago 138
iOS Question

Remove UITableView separator line

I want to remove following line, between 2 views. That line separate 2 UITableViewCell's:

enter image description here

I declared table view as following:

self.tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
self.tableView.delegate = self;
self.tableView.dataSource = self;
self.tableView.keyboardDismissMode = UIScrollViewKeyboardDismissModeOnDrag;
self.tableView.scrollEnabled = NO;
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
self.tableView.estimatedRowHeight = 85.0;
self.tableView.rowHeight = UITableViewAutomaticDimension;

So i actually wrote -
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;

Why that still exist?

Answer Source

Objective-C :

[self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];


self.tableView.separatorStyle = UITableViewCellSeparatorStyle.None

Apply the line in viewDidLoad() method.

If you want to do it from nib file, set the tableView's Separator property to None

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download