Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove separation between UITableView cells

I want to remove the built in separation between cells in UITableView.

I tried using :

[self.myTableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];

But that only removes the separator line. I need the view to appear as if it's not a table view at all. (like the tableview is one big view who doesn't contain many separated cells)

Is that possible ?

Edit: See the separation between the cells? I wan't it to disappear and the table view to be as if it's one big cell.

enter image description here

Edit 2: The problem doesn't appear when I don't use an image view as the cell background, but just use a simple background color. I tried using a different image, and as you can see the problem is much less obvious. I would still appreciate a solution for the red image though, since I do have a lot of images that still can't be put as background currently. (Not sure why one image would cause the problem and other won't ,I guess something with the pic setting)

enter image description here

like image 990
Idan Avatar asked Jan 31 '11 18:01

Idan


4 Answers

Go StroyBaord -> Select Table -> Attribute inspector -> Separator None No Separator Will Appear enter image description here

like image 174
AyAz Avatar answered Sep 21 '22 19:09

AyAz


You can do something like

self.tableView.separatorColor = [UIColor whiteColor];

or

self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;

I suppose in your case it would be

self.myTableView.separatorColor = [UIColor whiteColor];

In the future you might want to search Stack Overflow as there are many similar questions.

like image 19
aqua Avatar answered Oct 15 '22 14:10

aqua


Your separation is due to the background gradient in the red example and it is not coming from the tableView. in your second image there is no gradient so you don't see separation.

remove the gradient from the background image and it will be fine.

like image 7
shannoga Avatar answered Oct 15 '22 15:10

shannoga


try to do this:

self.tableView.backgroundColor=[UIColor clearColor];
self.tableview.separatorColor=[UIColor clearColor];
self.view.backgroundColor=[UIColor yourcolor];

i don't remember if it's then color with image or backgroundwithimage or background with view.. don't remember, however logic way is this.

hope it's usefull

like image 6
italianGuy Avatar answered Oct 15 '22 15:10

italianGuy