Swift 去除 TableView 多余的空Cell中的横线的方法

Swift 去除 TableView 多余的空Cell中的横线的方法

在使用 UITableViewController 的时候,多余的空 cell 会默认展示很多横线。

如何去除呢?

footerHeight 反一个极小的值就可以了

override func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
  return 0.001
}

结果

Swift 去除 TableView 多余的空Cell中的横线的方法

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。