iOS 15中 UITableView 新增了一个属性:sectionHeaderTopPadding
。此属性会给每一个 section header 增加一个默认高度,当我们使用 UITableViewStylePlain 初始化UITableView 的时候,系统默认给 section header 增高了22像素。
解决办法:
if #available(iOS 15.0, *) {
tableView.sectionHeaderTopPadding = 0
}
网友评论