Ios 无法为UITableView中的节禁用页脚

Ios 无法为UITableView中的节禁用页脚,ios,swift,uitableview,Ios,Swift,Uitableview,我正在使用UITableView分组并使用多个部分。我使用这些代码来隐藏节的页脚 self.tableView.estimatedSectionFooterHeight = 0 self.tableView.sectionFooterHeight = 0 public func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { return 0.0

我正在使用
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()

}
没有隐藏节0的唯一页脚

以下是截图:


请帮忙

如果您使用的是
分组表视图
,那么将始终存在页脚,并且它从不接受
0值
。但是你可以返回
0.5
1
来解决你的问题,并且不需要覆盖
viewforfooterInstitution
很抱歉打扰大家,我所做的是我还隐藏了没有任何行的部分和页眉

因此,当我在
viewForHeaderInSection
中返回空的
UIView()
时,其中一个标题没有被隐藏。虽然对于没有行的部分,我在
heightForHeaderInSection
中返回了0

现在,当我在
viewForHeaderInSection
中返回
nil
时,问题就解决了

截图:

考虑到您发布的代码,实现这两种页脚方法中的任何一种都有什么意义?如果您确实有更复杂的代码,请更新显示实际代码的问题,以便我们可以帮助您找到问题。已尝试,但相同的输出没有更改