Is it possible to disable floating headers in UITableView with UITableViewStylePlain?

前端 未结 29 1055
走了就别回头了
走了就别回头了 2020-11-29 15:02

I\'m using a UITableView to layout content \'pages\'. I\'m using the headers of the table view to layout certain images etc. and I\'d prefer it if they didn\'t

29条回答
  •  遥遥无期
    2020-11-29 15:20

    To remove the floating section header sections completely, you can do this:

    - (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
    {
        return [[UIView alloc] init];
    }
    

    return nil doesn't work.

    To disable floating but still show section headers you can provide a custom view with its own behaviours.

提交回复
热议问题