Is there a way to remove the separator line from a UITableView?
You can do this with the UITableView
property separatorStyle
. Make sure the property is set to UITableViewCellSeparatorStyleNone
and you're set.
Objective-C
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
In Swift (prior to 3)
tableView.separatorStyle = .None
In Swift 3/4/5
tableView.separatorStyle = .none
You can do this in the storyboard / xib editor as well. Just set Seperator to none.
I still had a dark grey line after attempting the other answers. I had to add the following two lines to make everything "invisible" in terms of row lines between cells.
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
self.tableView.separatorColor = [UIColor clearColor];
- (void)viewDidLoad {
[super viewDidLoad];
[self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];
}