美文网首页
iOS 15 UITableView sectionHeader

iOS 15 UITableView sectionHeader

作者: KingWorld | 来源:发表于2021-10-25 14:19 被阅读0次

    iOS 15中 UITableView 新增了一个属性:sectionHeaderTopPadding。此属性会给每一个 section header 增加一个默认高度,当我们使用 UITableViewStylePlain 初始化UITableView 的时候,系统默认给 section header 增高了22像素。

    解决办法:

    if #available(iOS 15.0, *) {
                tableView.sectionHeaderTopPadding = 0
            }
    

    相关文章

      网友评论

          本文标题:iOS 15 UITableView sectionHeader

          本文链接:https://www.haomeiwen.com/subject/urgjaltx.html