iOS 解决UITableView留白问题

1.如果tableview的style是plain模式:
设置self.automaticallyAdjustsScrollViewInsets = NO;

2. 如果是group模式:
-  (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    return section ==0?0.1f:8.0f;// 0.1f:防止tableView顶部留白一块
}

你可能感兴趣的:(iOS 解决UITableView留白问题)