无法禁用 UITableView 分组中部分的页脚

Sub*_*der 2 uitableview ios swift

我正在使用UITableView分组并使用多个部分。我正在使用这些代码来隐藏部分的页脚。

 self.tableView.estimatedSectionFooterHeight = 0
 self.tableView.sectionFooterHeight = 0

 public func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {

    return 0.0

}

public func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {

    return UIView()

}
Run Code Online (Sandbox Code Playgroud)

只有第 0 部分的页脚没有被隐藏。

这是屏幕截图:

在此输入图像描述

请帮忙!

Uma*_*mir 5

如果您正在使用grouped tableview,那么总会有页脚,并且它永远不会接受0 value。但您可以返回0.51解决您的问题,无需覆盖viewForFooterInSection