MJRefresh基础使用 https://www.cnblogs.com/bossren/p/6285779.html
MJ刷新异常,上拉加载出现跳动刷新问题:
解决办法:初始化的时候增加以下代码(tableView和collectionView类似)
if (@available(iOS11.0, *)) {
_tableView.contentInsetAdjustmentBehavior =UIScrollViewContentInsetAdjustmentNever;
_tableView.estimatedRowHeight = 0;
_tableView.estimatedSectionHeaderHeight = 0;
_tableView.estimatedSectionFooterHeight = 0;
}
自定义刷新动画
1:MJRefresh.h头文件
import "MJRefreshNormalHeader.h"
import "MJRefreshGifHeader.h"
import "MJRefreshBackNormalFooter.h"
import "MJRefreshBackGifFooter.h"
import "MJRefreshAutoNormalFooter.h"
import "MJRefreshAutoGifFooter.h"
这是MJRefresh.h头文件中包含的类,
2:以MJRefreshGifHeader类为例,写一个自定义的类WNXRefresgHeader继承 MJRefreshGifHeader。
3:在自定义类中重写prepare方法 e;
image
4:在控制器中进行刷新
image
刷新的操作就在自己定义的loadNewData方法中执行。