I want to remove the line between 2 views. The line that separates 2 UITableViewCell
s:
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 does it still exist?
To hide UITableViewCell separator completely, simply set it's colour to UIColor. clearColor(). This will make the cell separator not visible.
Add a Plain UIView to the Footer of the UITableView First, grab a plain UIView from the object browser, and drag it to the the footer position below all of your cell prototypes. It worked! The separator lines are gone.
Objective-C :
[self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];
Swift:
self.tableView.separatorStyle = UITableViewCellSeparatorStyle.None
Swift 5.0 renamed it in :
self.tableView.separatorStyle = UITableViewCell.SeparatorStyle.none
Apply the line in viewDidLoad() method.
If you want to do it from nib file, set the tableView's Separator property to None
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With