zoukankan      html  css  js  c++  java
  • 实现下拉刷新效果 IOS所有版本均可使用

    先上图,没图没真相  

    下拉刷新效果使用第三方类库

    ODRefreshControl

    例子目录结构:

    Resources    资源文件夹

    ThirdPartLib    第三方类库文件夹

    直接上核心调用代码,一共只有六句,简单好用。

    设置下拉刷新的位置

    V_animateIndicator *v = [[V_animateIndicator alloc] initWithFrame:CGRectMake(0.f, 0.f, 20.f, 20.f)];
    ODRefreshControl *refreshControl = [[ODRefreshControl alloc] initInScrollView:self.pTV_main activityIndicatorView:v];
    [refreshControl addTarget:self action:@selector(dropViewDidBeginRefreshing:) forControlEvents:UIControlEventValueChanged];

    下拉刷新后会调用的方法

    - (void)dropViewDidBeginRefreshing:(ODRefreshControl *)refreshControl
    {
        double delayInSeconds = 3.0;
        dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC);
        dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
            //下拉刷新后执行的操作 Start
            [self refreshCell];
            //下拉刷新后执行的操作 End
            [refreshControl endRefreshing];
        });
    }

    PRJ_pullDownRefresh.zip 例子代码地址:http://ishare.iask.sina.com.cn/f/34837888.html

  • 相关阅读:
    动态ip发布web+绑定域名
    JQuery选择器大全
    mysql触发器
    jquery选择器
    PHP5新语法学习
    Jquery中$.ajax()方法参数详解(转)
    svn笔记
    lsof命令
    新环境常用工具
    不会转载
  • 原文地址:https://www.cnblogs.com/thefeelingofsimple/p/2791637.html
Copyright © 2011-2022 走看看