UITableView 添加一下设置,关键是_tableView.estimatedRowHeight = 0;
if (@available(iOS 11.0, *)) {
_tableView.estimatedRowHeight = 0;
_tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
} else {
self.automaticallyAdjustsScrollViewInsets = NO;
}
@weakify(self);
MJRefreshAutoNormalFooter *footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
@strongify(self);
self->_tableView.pagingEnabled = NO;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self->_tableView.mj_footer endRefreshing];
self->_tableView.pagingEnabled = YES; // 耗时操作后设置
});
}];
footer.automaticallyChangeAlpha = YES;
footer.triggerAutomaticallyRefreshPercent = -10;
_tableView.mj_footer = footer;
网友评论