1 iOS tableView Section header 向下偏移的问题
在tableView中设置了section header, 代码如下

出现了header向下偏移的问题

- 首先检查的是tableView的contentInset, 未设置
- scrollView的 automaticallyAdjustsScrollViewInsets, 未设置
self.tableViewChat.contentInset = UIEdgeInsetsZero;
if (@available(iOS 11.0, *)) {
self.tableViewChat.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
} else {
self.automaticallyAdjustsScrollViewInsets = NO;
}
Google了相关问题, 设置下tableHeaderView, 解决了这个bug

网友评论