CodeGuy
CodeGuy

Reputation: 28905

Remove top gray line on UITableViewCell

I have a UITableViewCell and I want to remove the gray line on the top of it. How can I do this?

Upvotes: 4

Views: 2322

Answers (5)

Amish Shabani
Amish Shabani

Reputation: 759

I know it is too late to answer this question. However, in swift 3 solution is:

tableView.separatorStyle = .none

Upvotes: 1

tiritea
tiritea

Reputation: 1279

BTW this is arguably a bit better solution than setting the separator color to clear...

tableView.separatorStyle = UITableViewCellSeparatorStyleNone;

Upvotes: 4

Gurinder
Gurinder

Reputation: 11

return 0 from heightForHeaderInSection. Or delete this macro.

Thanks

Upvotes: 0

Kudit
Kudit

Reputation: 4379

For me, it seems to be a problem with the image tiling. I'm tiling a 320x480 image and there is a gray line at the break at the top as well as 480 pixels from the top. I'm setting my background like this:

self.tableView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"mybackground.png"]];

Cropping the image seemed to remove the gray line so I think it had something to do with the image itself.

Upvotes: 0

PengOne
PengOne

Reputation: 48398

use this to set the separator color to clear:

tableView.separatorColor = [UIColor clearColor];

Upvotes: 4

Related Questions