React-Native-Pull 正在参加 2021 年度 OSC 中国开源项目评选,请投票支持!
React-Native-Pull 在 2021 年度 OSC 中国开源项目评选 中已获得 {{ projectVoteCount }} 票,请投票支持!
2021 年度 OSC 中国开源项目评选 正在火热进行中,快来投票支持你喜欢的开源项目!
2021 年度 OSC 中国开源项目评选 >>> 中场回顾
React-Native-Pull 获得 2021 年度 OSC 中国开源项目评选「最佳人气项目」 !
授权协议 MIT
开发语言 JavaScript
操作系统 跨平台
软件类型 开源软件
开源组织
地区 国产
投 递 者 GreatOS
适用人群 未知
收录时间 2016-08-01

软件简介

react-native-pull 包含 PullView & PullList 两个实现下拉刷新滑动回弹效果的 react native 组件,可支持android & ios,简单易用!

纯s代码,基于ScrollView & ListView封装. 比scrollview & ListView更强大,有三个下拉状态:pulling、pullok、pullrelease。PullView可以让你使用refreshControl或提供的相关属性实现类似于scrollview的pull-to-refresh. PullList可以让你使用ListView的所有属性。

PullView Demo

PullView & PullList 实例项目: https://github.com/greatbsky/react-native-pull-demo

PullView 使用方法

  1. 执行npm install react-native-pull --save

  2. 编写代码:

    import {PullView} from 'react-native-pull';
    
    onPullRelease(resolve) {
      //do something
      resolve();
    }
    
    <PullView onPullRelease={this.onPullRelease}>
    //sth...
    </PullView>
  3. 完整代码: https://github.com/greatbsky/react-native-pull-demo/blob/master/PullViewDemo/app.js

PullList Demo

PullList 使用方法

  1. 执行 npm install react-native-pull --save

  2. 编写代码:

    import {PullList} from 'react-native-pull';
    
      onPullRelease(resolve) {
        //do something
        resolve();
      }
    
      <PullList onPullRelease={this.onPullRelease} {...and some ListView Props}/>
  3. 完整代码: https://github.com/greatbsky/react-native-pull-demo/blob/master/PullListDemo/app.js

更多配置项

PullView & PullList 下拉效果属性

  1. : 设置组件样式,比如可以设置width/height/backgroudColor等

  2. onPulling: 处于pulling状态时执行的方法

  3. onPullOk: 处于pullok状态时执行的方法

  4. onPullRelease: 处于pullrelease状态时执行的方法

  5. topIndicatorRender: 顶部刷新指示组件的渲染方法, 接受三个参数: ispulling, ispullok, ispullrelease

  6. topIndicatorHeight: 顶部刷新指示组件的高度, 若定义了topIndicatorRender则同时需要此属性

  7. isPullEnd: 是否已经下拉结束,若为true则隐藏顶部刷新指示组件,非必须

    仅PullView支持普通refreshcontrol的相关属性

  • onRefresh: 开始刷新时调用的方法

  • refreshing: 指示是否正在刷新

展开阅读全文

代码

的 Gitee 指数为
超过 的项目

评论

点击引领话题📣
暂无内容
发表了博客
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
发表了问答
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
暂无内容
0 评论
11 收藏
分享
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部