UITableViewGrouped style viewForHeaderInSection show

UITableView 为 uitableviewstylegrouped 时的一些 注意项

viewForHeaderInSection

TableView 的第一个Section的HeaderView 在未设置heightForHeaderInSection代理时会隐藏

-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    return 20;
}

image.png

viewForHeaderInSection

设置为0 时,依然有默认高度,需要返回0.01或者 CGFLOAT_MIN

-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    return CGFLOAT_MIN;//如果没有会有默认高度
}
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容