UITableView Not Respecting heightForHeaderInSection/heightForFooterInSection?

后端 未结 9 1681
臣服心动
臣服心动 2020-12-09 02:57

I have a UITableView where in some instances, certain sections have zero rows. My goal is that when this is true, I don\'t want any wasted space in the table view, it should

9条回答
  •  心在旅途
    2020-12-09 03:25

    Actually, with me it is happening other way round. I have assigned section header to be 10 in xib, but for the first section, I want a header of size header. I am using this method in my UITableViewCotroller

    - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        if(indexPath.section==0)
            return 125;
        return tableView.rowHeight;
    }
    

    But the section header heights are not changed, even though the method is getting called.

提交回复
热议问题