美文网首页
tableView顶部多出一片空白区域

tableView顶部多出一片空白区域

作者: lanmoyingsheng | 来源:发表于2018-08-10 15:56 被阅读13次

绝大部分是没有实现一下方法

func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
      return nil
}

func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {

    return  0.01
}

即使返回的header是nil不可以设置height为0,否则还会出现空白

相关文章

网友评论

      本文标题:tableView顶部多出一片空白区域

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