我可以在 XCode 中通过 Interface Builder 执行以下操作吗?
self.tableView.tableFooterView = UIView(frame: CGRectZero)
我需要删除表格 View 底部的空单元格。
提前致谢。
最佳答案
是的,您只需要将一个 UIView 作为 tableFooterView 添加到您的 tableview 中。使用通用的 tableFooterView,将不再显示空单元格。
在您所说的代码中:
self.tableView.tableFooterView = UIView(frame: CGRectZero)
在 IB/ Storyboard中:
只需将一个 UIView 拖到您的 UITableView 中。如果您不能将它直接放在 Sections 之后,那么将它放在 Sections 之前(作为 tableHeaderView),然后将其拖到 Sections 之后。它将被视为 tableview 的页脚 ;-)
关于ios - 是否可以通过 Interface Builder 删除表格 View 底部的空单元格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27178115/