ios11.0 later, after the pull-down refresh blank table can not go back, pull-refresh issues a jump stop solution

Internet search a lot, but many say that is not clear, as the xcode novice do not understand, then combined with many conclusions, here record my solution:

Only need MJRefreshHeader.m modified as follows section

- (void)placeSubviews

{

    [super placeSubviews];

    

    // set y value (when their height changed, and will certainly have to re-adjust the Y value, so put placeSubviews method to set the value of y)

    self.mj_y = - self.mj_h - self.ignoredScrollViewContentInsetTop;

 

    

    if (@available(iOS 11.0, *)) {

        self.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;

        if ([self.scrollView isKindOfClass:[UITableView class]]) {

            // iOS tableView 11 automatically considered high by default automatically open, do not want to have to use such a close

            UITableView *tableView = (UITableView *)self.scrollView;

            tableView.estimatedRowHeight = 0;

            tableView.estimatedSectionHeaderHeight = 0;

            tableView.estimatedSectionFooterHeight = 0;

        }

    } 

  

}

 In order to solve before beating the pull-refresh problems, set these lines (also find online programs) at each table is initialized, easy to use, but later found that by modifying the above MJRefreshHeader.m later, these lines without also it, eliminating the need to modify each table once trouble. Different versions of the code in the hands of everyone, got all the programs are for reference only.

        self.tableView.estimatedRowHeight = 0;

        self.tableView.estimatedSectionHeaderHeight = 0;

        self.tableView.estimatedSectionFooterHeight = 0;

Guess you like

Origin blog.csdn.net/prettynacl/article/details/90923014
Recommended