就是項目中發現的問題而已
// tableView 偏移20/64適配
if(@available(iOS11.0, *)) {
self.tableView.contentInsetAdjustmentBehavior=UIScrollViewContentInsetAdjustmentNever;//UIScrollView也適用
}else{
self.automaticallyAdjustsScrollViewInsets=NO;
}
// tableView 如果是Gruop類型的話,section之間的間距變寬,執行返回高度的同時還需要執行return UIView的代理
- (CGFloat)tableView:(UITableView*)tableView heightForHeaderInSection:(NSInteger)section{
return10;
}
- (CGFloat)tableView:(UITableView*)tableView heightForFooterInSection:(NSInteger)section{
return0.1;
}
- (UIView*)tableView:(UITableView*)tableView viewForHeaderInSection:(NSInteger)section {
return[[UIViewalloc]init];
}
- (UIView*)tableView:(UITableView*)tableView viewForFooterInSection:(NSInteger)section {
return[[UIViewalloc]init];
}