Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

delete lines between UITableViewCells in UITableView

I've created an UITableView with UITableViewCell. Between the view cells there are grew lines. I want to delete these lines and don't want to show them, but I don't know how.

I work with Xcode 6.1 and Swift.

Here is a screenshot that displays my screen:

enter image description here

THX!

like image 713
GRme Avatar asked Oct 30 '14 13:10

GRme


People also ask

How do I delete extra cells in UITableView?

So, to remove a cell from a table view you first remove it from your data source, then you call deleteRows(at:) on your table view, providing it with an array of index paths that should be zapped. You can create index paths yourself, you just need a section and row number.

How do I remove a separator line in Swift?

To hide UITableViewCell separator completely, simply set it's colour to UIColor. clearColor(). This will make the cell separator not visible.

How do you add a space between UITableView cells?

The way I achieve adding spacing between cells is to make numberOfSections = "Your array count" and make each section contains only one row. And then define headerView and its height. This works great.

What is the difference between UITableView and UICollectionView?

For the listing details of each item, people use UITableView because it shows more info on each item. The UICollectionView class manages an ordered collection of data items and presents them using customizable layouts.


2 Answers

Using Objective-C, we have:

[self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone]; 

for Swift 3:

self.tableView.separatorStyle = .none 

for Swift 2:

self.tableView.separatorStyle = UITableViewCellSeparatorStyle.None 

OR:

if you are using the InterfaceBuilder, you can set the tableView's Separator property to None enter image description here

like image 130
instaable Avatar answered Sep 29 '22 10:09

instaable


Within InterfaceBuilder you can set the Separator property to None or do it programmatically by setting the property separatorStyle of your table view to UITableViewCellSeparatorStyleNone.

like image 24
anka Avatar answered Sep 29 '22 11:09

anka