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
delete lines between UITableViewCells in UITableView
提问by Martin
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.
我创建了一个UITableView
with UITableViewCell
。在视图单元格之间有生长线。我想删除这些行,不想显示它们,但我不知道如何。
I work with Xcode 6.1 and Swift.
我使用 Xcode 6.1 和 Swift。
Here is a screenshot that displays my screen:
这是显示我的屏幕的屏幕截图:
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 None
如果您使用的是InterfaceBuilder,则可以将 tableView 的 Separator 属性设置为None
回答by anka
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
.
在 InterfaceBuilder 中,您可以将Separator
属性设置为None
或通过将separatorStyle
表视图的属性设置为以编程方式执行此操作UITableViewCellSeparatorStyleNone
。
回答by Marcos Reboucas
Swift 3:
斯威夫特 3:
tableView.separatorStyle = UITableViewCellSeparatorStyle.none
回答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 时。它可以设置或通过故事板或笔尖