Remove unnecessary split lines in UITableView or hide split lines between cells.
I. Remove extra split lines from tableViewFirst, customize a method-(void) setExtraCellLineHidden: (UITableView *) tableView
{
UIView * view = [UIView new];
View. backgroundColor = [UIColor clearColor];
[TableView setTableFooterView: view];
} Call the preceding method in viewDidLoad or tableView creation.
-(Void) viewDidLoad
{
[Super viewDidLoad];
// Set tableView to not scroll
[Self. tableView setScrollEnabled: NO];
// Call it here: assume that the name of tableView is tableView.
[Self setExtraCellLineHidden: self. tableView];
}
Ii. How to hide the split line in tableView
In viewDidLoad or when you create a tableView,
There is a built-in attribute: (Suppose the defined name is tableView)
TableView. separatorStyle = UITableViewCellSeparatorStyleNone;
You can hide the split lines between cells;