美文网首页
解决 UITableView 设置heightForHeader

解决 UITableView 设置heightForHeader

作者: 天山海梦 | 来源:发表于2020-08-11 17:05 被阅读0次

设置heightForHeaderInSection 和 heightForFooterInSection不起作用:

  • (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
    {

    return 0.01;
    }

  • (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
    {

    return 0.01;
    }
    解决办法:

self.tableView.sectionHeaderHeight = 0.01;
self.tableView.sectionFooterHeight = 0.01;

希望这部文章能解决小伙伴的燃眉之急,解决之后记得点赞啊。。。

相关文章

网友评论

      本文标题:解决 UITableView 设置heightForHeader

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