美文网首页
iOS11 PageEnabled MJRefresh 偏移

iOS11 PageEnabled MJRefresh 偏移

作者: cocoaroger | 来源:发表于2018-07-05 18:05 被阅读182次

    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;
    

    相关文章

      网友评论

          本文标题:iOS11 PageEnabled MJRefresh 偏移

          本文链接:https://www.haomeiwen.com/subject/ykzpuftx.html