QMUI_iOS icon indicating copy to clipboard operation
QMUI_iOS copied to clipboard

QMUI emptyView与MJRefresh同时使用的时候,刷新会导致emptyview闪烁偏移

Open Merlini93 opened this issue 6 years ago • 1 comments

Bug 表现 mjrefreshheader和showEmptyViewWithImage方法合用的时候出现显示bug

截图 `[self showEmptyViewWithImage:[UIImage imageNamed:@"tz_pic_hdxxmrt"] text:@"测试测试" detailText:@"奥斯卡" buttonTitle:@"按时" buttonAction:nil]; self.tableView.mj_header = [MJRefreshStateHeader headerWithRefreshingBlock:^{ [self hideEmptyView]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [self.tableView.mj_header endRefreshing];

        [self showEmptyViewWithImage:[UIImage imageNamed:@"tz_pic_hdxxmrt"] text:@"测试测试" detailText:@"奥斯卡" buttonTitle:@"按时" buttonAction:nil];
    });
}];`

如何重现

  1. 新建一个工程,将代码加进去
  2. 下拉刷新,观察emptyview 的位置
  3. 在松开手的时候emptyview会向上移动,刷新完毕后又会向下移动回到原来的位置

预期的表现 emptyview应该固定在tableview跟随一起滑动

其他信息

  • 设备: iPhone模拟器
  • iOS 版本: [iOS 13.3]
  • Xcode 版本: [Xcode 11.3]
  • QMUI 版本: [4.0.4]

Merlini93 avatar Jan 08 '20 10:01 Merlini93

我监控了一下,是由于contentinset的变更,emptyview的frame进行了变化,因此做了下面的更改,暂时没发现问题,在layoutEmptyView 进行如下处理,判断contentinset变更是否与MJfresh头部高度一致,强行变为0 if (tableView.mj_header && tableView.mj_header.frame.size.height == insets.top) {

insets.top = 0;

}

runcong1989 avatar Jul 01 '22 07:07 runcong1989