![enter image description here](https://i.stack.imgur.com/lBc66.png)
contentSize
представления таблицы примерно на 20 выше, чем кадр.
Это должно быть то же самое, что и кадр, так как я уже выключил все связанные вещи.
Я получил три строки в одном-единственном разделе. Высота каждого ряда 46.
Таким образом, высота в целом должна быть 46 * 3 = 138. Но это не так.
Это действительно сильно смутило меня.
Верхний и нижний колонтитул раздела - 0,001.
Представление таблицы унаследовано от MATableView
, инициализатор которого выглядит следующим образом.
class MATableView: UITableView {a
init(frame: CGRect, presentOn object: AnyObject) {
super.init(frame: frame, style: .grouped)
delegate = (object as! UITableViewDelegate)
dataSource = (object as! UITableViewDataSource)
bounces = false
backgroundColor = .white
separatorStyle = .none
tableHeaderView = UIView(frame: CGRect(x: 0, y: 0, width: 0, height: 0.01))
tableFooterView = UIView(frame: CGRect(x: 0, y: 0, width: 0, height: 0.01))
showsVerticalScrollIndicator = false
estimatedRowHeight = 0
estimatedSectionHeaderHeight = 0
estimatedSectionFooterHeight = 0
showsVerticalScrollIndicator = false
if #available(iOS 11.0, *) {
self.contentInsetAdjustmentBehavior = .never
}
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
// In the delegate controller
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 0.001
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 0.001
}
Любой совет будет оценен.