• 在MJRefresh的基础上实现动画的自定义和自动下拉刷新


    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

  • 相关阅读:
    函数
    特殊集合
    集合
    数组复习
    数组
    IPython--转
    python 单例模式总结
    拼多多笔试题
    python 创建实例--待完善
    转--算法时间复杂度
  • 原文地址:https://www.cnblogs.com/ytmaylover/p/5345434.html
Copyright © 2020-2023  润新知