1.提前准備:
(1) TYDotIndicatorView https://github.com/itouch2/TYDotIndicatorView.git
(2) MJRefresh https://github.com/CoderMJLee/MJRefresh.git
(3) XHToast https://github.com/CoderZhuXH/XHToast
2 (1) 在XHToast中修改陰影框的長度,可以實現刷新成功之后提示更新了多少條數據:
.
(2)在請求網絡數據之后,調用此方法,實現提示更新了多少條數據,
3.
(1)在Base中的MJRefreshead正價下面方法:
(2)在.m文件中,實現方法,讓其刷新
-(void)autoRefreashHeader{ [self beginRefreshing]; }
(3) 在加載時圖之后,調用autore freas h方法:加載數據之后2秒之后自動刷新,
4.替換等待刷新時的風火輪,替換為TYDotIndicatorView 的一個時圖,效果如下:
(1) 在 MJRefreshNormalHeader.h 中引入頭文件,講自帶的 loadingView注釋掉,用自定義的視圖退換
#import "MJRefreshNormalHeader.h" #import "TYDotIndicatorView.h" @interface MJRefreshNormalHeader() { __weak UIImageView *_arrowView; } //@property (weak, nonatomic) UIActivityIndicatorView *loadingView; @property (weak ,nonatomic)TYDotIndicatorView *loadingView;
(2)替換懶加載方法,實現自定義的方法:dotsize時顯示的大小可以自行定義,
(3) 在placeSubviews中設置葯將要顯示的weiz