UITableView 添加一下设置,关键是_tableView.estimatedRowHeight = 0
;
if (@available(iOS 11.0, *)) {
_tableView.estimatedRowHeight = 0;
_tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
} else {
self.automaticallyAdjustsScrollViewInsets = NO;
}
在MJRefreshBackFooter.m中,- (void)scrollViewContentOffsetDidChange:(NSDictionary *)change方法内的if (self.state == MJRefreshStateRefreshing) return;改成
// 如果正在刷新,直接返回
if (self.state == MJRefreshStateRefreshing)
{
// 修复 pageEnable 造成的偏移
if (self.scrollView.pagingEnabled == NO) return;
CGFloat refreshingOffset = [self happenOffsetY] + self.mj_h;
if (refreshingOffset != self.scrollView.mj_offsetY)
{
self.scrollView.mj_offsetY = [self happenOffsetY] + self.mj_h;
}
return;
}
网友评论