ios8以上UITableView留白問題

當cell的類型是plaint類型時,直接設置self.automaticallyAdjustsScrollViewInsets=NO;應該就能夠的
當cell的類型是group類型時,此時要去掉tableView頂部的空白鬚要兩步:
1.設置tableView的tableHeaderView高度爲0.5;
self.MenuTable.tableHeaderView=[[UIview alloc] initWithFrame:(CGRectMake(0,20,82,0.5))];
2.設置heightForHeaderInSection的高度爲0.5
-(CGFloat)tableView:(UItableView *)tableView heightForHeaderInSection(NSInteger)section{
return 0.5;
}it

相關文章
相關標籤/搜索