How to remove separation between cells UITableView

I want to remove inline separation between cells in a UITableView.

I tried using:

[self.myTableView setSeparatorStyle:UITableViewCellSeparatorStyleNone]; 

But this only removes the dividing line. I need the view to appear as if it weren’t viewing the table at all. (e.g. tableview is one big view that does not contain many individual cells)

Is it possible?

Edit: See Separation between cells? I don’t want it to disappear, but the table looks as if it is one big cell.

enter image description here

Edit 2: The problem does not occur when I do not use the image view as the background of the cell, but simply use a simple background color. I tried using a different image, and as you can see, the problem is much less obvious. However, I will still be grateful for the solution for the red image, since I have a lot of images that still cannot be placed as the background at this time. (I don’t know why one image will cause a problem and another not, I think something with the pic setting)

enter image description here

+7
source share
7 answers

You can do something like

self.tableView.separatorColor = [UIColor whiteColor];

or

self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;

I believe that in your case it will be

self.myTableView.separatorColor = [UIColor whiteColor];

In the future, you may need to look for Stack Overflow, as there are many similar questions .

+17
source

Separation is due to the background gradient in the red example, and this does not come from the View table. there is no gradient in the second image, so you do not see the separation.

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

+7
source

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 is then a color with an image or background with an image or background with a view .. I don’t remember, no matter how logical it is.

hope this is helpful

+5
source

If you just want to get rid of the separator between cells of a UITableView. Two things you need.

  • [self.tableView setSeparatorStyle: UITableViewCellSeparatorStyleNone];
  • Make sure your imageView (in the tableview cell) is the same height as the tableview cell. This means that your image completely covers the table view cell. Look at the inspector's view and check the height, if you see that the height is 43, just set it to 44 (44 is the default cell height of the table to display the retina).

enter image description hereenter image description hereenter image description here

+2
source

It seems you answered your question. If you need a solid color background, make an image with a solid color. I suspect this is not the best practice, but it will do its job.

+1
source

Go to StroyBaord → Select Table → Attribute Inspector → Separator No No separator will appear enter image description here

+1
source

I have done this many times in my applications. I understand that you want your table view to look like it is not a table view, but as if it were on an empty piece of paper.

Just a note for you, the reason why you can see the separation with some images and not so much with others is related to its image texture. When you place copies of the image side by side, they do not have a continuous template, forming obvious visual selections.

Solution: Assuming you have a tableview setting in an xib file, display the background of the table itself to clear →, then set the background of the view itself to any image you like. Then you will have a table view, while the transparent view of the background will be transparent, and only the main view behind it will show its image or color. Displaying your image on this canvas will mean a clear single background image.

0
source

All Articles