1.当cell的类型是plaint类型时,直接设置:
self.automaticallyAdjustsScrollViewInsets=NO;
2.当cell的类型是group类型时,此时要去掉tableView顶部的空白需要两步:
2-1.设置tableView的tableHeaderView高度为0.5:
self.MenuTable.tableHeaderView=[[UIview alloc] initWithFrame:(CGRectMake(0,20,82,0.5))];
2-2.设置heightForHeaderInSection的高度为0.5
-(CGFloat)tableView:(UItableView *)tableView heightForHeaderInSection(NSInteger)section{
return 0.5;
}