ios 删除 UITableView 中 UITableViewCells 之间的行

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26653883/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 03:26:11  来源:igfitidea点击:

delete lines between UITableViewCells in UITableView

iosxcodeuitableviewswift

提问by Martin

I've created an UITableViewwith 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.

我创建了一个UITableViewwith UITableViewCell。在视图单元格之间有生长线。我想删除这些行,不想显示它们,但我不知道如何。

I work with Xcode 6.1 and Swift.

我使用 Xcode 6.1 和 Swift。

Here is a screenshot that displays my screen:

这是显示我的屏幕的屏幕截图:

enter image description here

在此处输入图片说明

THX!

谢谢!

回答by instaable

Using Objective-C, we have:

使用Objective-C,我们有:

[self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];

for Swift 3:

对于Swift 3

self.tableView.separatorStyle = .none

for Swift 2:

对于Swift 2

self.tableView.separatorStyle = UITableViewCellSeparatorStyle.None

OR:

或者:

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

如果您使用的是InterfaceBuilder,则可以将 tableView 的 Separator 属性设置为None在此处输入图片说明

回答by anka

Within InterfaceBuilder you can set the Separatorproperty to Noneor do it programmatically by setting the property separatorStyleof your table view to UITableViewCellSeparatorStyleNone.

在 InterfaceBuilder 中,您可以将Separator属性设置为None或通过将separatorStyle表视图的属性设置为以编程方式执行此操作UITableViewCellSeparatorStyleNone

回答by Marcos Reboucas

Swift 3:

斯威夫特 3:

tableView.separatorStyle = UITableViewCellSeparatorStyle.none

回答by Savas Adar

You can do it from storyboard like this;

你可以像这样从故事板中做到这一点;

ss

SS

回答by pratik bhiyani

Swift 5 :

斯威夫特5:

cell.selectionStyle = UITableViewCell.SelectionStyle.none

回答by Randhir Kumar

tableView.separatorStyle = .none

tableView.separatorStyle = .none

when initializing the tableview. It can be set or through the storyboard or nib

初始化 tableview 时。它可以设置或通过故事板或笔尖