swift - 快速减少表格视图部分之间的差距
问题描述
我想快速缩小表格视图部分之间的差距。我试过“.leastNormalMagnitude”。但是我仍然在各个部分之间获得了一些空间。我想应该没有空间。谁能帮我?
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return CGFloat.leastNormalMagnitude
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
解决方案
要隐藏部分标题:
override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return nil
}
override func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return .zero
}
推荐阅读
- javascript - 打破柏树中的if循环
- ms-access - 访问:当我更改表单组合框中的值时,如何自动填充字段
- c# - 如何在非 WinForms 程序集中抽取 STA 线程?
- php - angularJs 和 PHP 发送电子邮件表单
- python-3.x - 部署到 AWS 失败,requirement.txt 返回非零退出状态 1
- git - 如何在没有 Jenkins CI 的情况下从 gitlab 触发 jenkins?
- android - 滚动视图中的两个回收器视图
- javascript - PHP 和 jquery Ajax 和用于过滤的无限滚动
- c++ - 洪水填充算法发现所有区域(扫雷)
- python-3.x - 是否有按顺序返回链接列表的 __str__ 函数?