1.问题描述:今天写一个tableView的时候偶然发现tableView的顶部留有空白,也就是cell不是在tableView的顶部显示。如下图:
上图是头部留有空白的情况(红色是tableView,灰色是cell)
上图是正常显示的,也就是cell是要贴紧tableView的顶部开始显示。
根据这种情况我又新建了一个tableView:
代码1:
UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height