Default height for section header in UITableView

后端 未结 8 2076
无人共我
无人共我 2020-12-07 12:55

I want to set the height of the first header in my UITableView. For the other headers I want them to remain the default height. What value/constant can I put in place of \"s

8条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-07 13:34

    This should do the trick

    - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        if(indexPath.section == CUSTOM_SECTION)
        {
            return CUSTOM_VALUE;
        }
        return [tableView rowHeight];
    }
    

提交回复
热议问题