这个问题在这里已有答案:
我已经创建了一个带有xib文件的自定义UITableViewCell类 .
在单元格xib中,我将表格视图单元格的分隔符设置为"Custom Insets",其中left = 0,right = 0:
但是,当我运行我的应用程序时,它仍显示如下所示的底线:
如何删除xib文件的界面生成器中的分隔线?如果不可能,那么进步的方式是什么? (顺便说一句,在界面构建器中这样做是我的偏好)
您必须删除tableview的Attributes检查器中的分隔线,如下图所示:
将 UITableView 的 Separator Style 设为 none
UITableView
Separator Style
none
或者,以编程方式
Swift 3+
tableView.separatorStyle = .none
Objective-C
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
要从 UITableView 删除额外的saparator行,您需要设置 tableFooterView 的 UITableView
tableFooterView
tableView.tableFooterView = UIView()
您似乎正在使用旧版本的Xcode . 如果要删除分隔线,则必须选择 default 选项表单 separator inset 并从 separator 中选择 none .
default
separator inset
separator
Follow this image
否则,您也可以通过编程方式进行设置
yourTableView.separatorStyle = .none
4 回答
您必须删除tableview的Attributes检查器中的分隔线,如下图所示:
将
UITableView
的Separator Style
设为none
或者,以编程方式
Swift 3+
Objective-C
要从
UITableView
删除额外的saparator行,您需要设置tableFooterView
的UITableView
您似乎正在使用旧版本的Xcode . 如果要删除分隔线,则必须选择
default
选项表单separator inset
并从separator
中选择none
.Follow this image
否则,您也可以通过编程方式进行设置
Swift 3+