删除Grouped UITableView中各节之间的垂直空间

Dan*_*aio 2 uitableview ios swift

我一直在寻找这个,并没有找到适合我的解决方案.

我设置了UITableViewGrouped每节头将举行一个UIView将被用来表示一个问题上的问答应用程序,每节将举行一系列将被用来代表行的回答到先前的问题.

问题是:每个节组之间有一个垂直间距,我想删除它.

红色字幕解释

我已经尝试过做这样的建议在这里,但看起来它并没有奏效.

我用了一个极小值也试图estimatedHeightForFooterInSection0.00001的建议在这里.但是我收到以下错误:

'section footer height must not be negative - provided height for section 1 is -0.000010'

有没有办法在不放弃策略的情况下完成这项工作(问题部分,答案行)?

Dan*_*aio 10

出于某种原因tableView.estimatedSectionFooterHeight = 0.0没有工作但是tableView.sectionFooterHeight = 0.0确实如此,即使有了UITableView.style = .grouped.

我也使用空的UIView作为我的页脚视图.

tableView.tableFooterView = UIView(frame: CGRect.zero)
tableView.sectionFooterHeight = 0.0
Run Code Online (Sandbox Code Playgroud)

感谢你的帮助!