Blank first UITableView section header

后端 未结 2 1683
遥遥无期
遥遥无期 2021-01-24 17:22

I have 2 sections in my UITableView. I\'d like my first header to be nonexistant, no space, no nothing. The first cell touches the top of the screen. I\'d like a custom section

相关标签:
2条回答
  • 2021-01-24 17:33

    Look for the

    - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section

    method of UITableView.

    You can return 0; for the first section.

    0 讨论(0)
  • 2021-01-24 17:33

    Use this,

    - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
    {
        if (section == 0){       
            return 0;
        }
        //...
    }
    
    0 讨论(0)
提交回复
热议问题