How do I remove the borders of a UITableView?

IphoneCocoa TouchUitableview

Iphone Problem Overview


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?

Iphone Solutions


Solution 1 - Iphone

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];

Solution 2 - Iphone

Use this

tableView.separatorStyle = UITableViewCellSeparatorStyleNone;

Solution 3 - Iphone

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;

Solution 4 - Iphone

This did the trick for me:

[dayTableView setSeparatorColor:[UIColor whiteColor]]; //or your background color

Solution 5 - Iphone

swift 4 use

myTableView.separatorStyle = UITableViewCellSeparatorStyle.none

Solution 6 - Iphone

How about setSeparatorColor to your cell's background color?

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionVparabView Question on Stackoverflow
Solution 1 - IphoneSam SoffesView Answer on Stackoverflow
Solution 2 - Iphonepradeep dhyaniView Answer on Stackoverflow
Solution 3 - IphoneGabrielView Answer on Stackoverflow
Solution 4 - IphoneAkshay ShahView Answer on Stackoverflow
Solution 5 - IphoneNoer CholisView Answer on Stackoverflow
Solution 6 - IphoneleonhoView Answer on Stackoverflow