问题
I have subclassed the UITableView control, and the style is grouped, but I do not need the cell separators. I tried setting my table view's separatorStyle to none, but it doesn't work. Can any one help me out?
回答1:
In a grouped table view, setting separatorStyle
doesn't do anything. If you want to hide it, just do the following:
tableView.separatorColor = [UIColor clearColor];
回答2:
Use this
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
回答3:
To remove the border of a table view write this line:
self.myTableView.separatorColor = [UIColor clearColor];
If you want to remove both the border of a table view but the border between cells too, you have to write both lines:
self.myTableView.separatorColor = [UIColor clearColor];
self.myTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
回答4:
This did the trick for me:
[dayTableView setSeparatorColor:[UIColor whiteColor]]; //or your background color
回答5:
How about setSeparatorColor to your cell's background color?
回答6:
swift 4 use
myTableView.separatorStyle = UITableViewCellSeparatorStyle.none
来源:https://stackoverflow.com/questions/286332/how-do-i-remove-the-borders-of-a-uitableview