下拉刷新react native组件 react-native-pullview

码农软件 · 软件分类 · React 开源项目 · 2019-04-28 09:26:51

软件介绍

这是一个实现下拉刷新的react native组件,可支持android & ios,简单易用!

纯js代码,基于ScrollView封装. 比scrollview更强大,有三个下拉状态: pulling, pullok, pullrelease. 还可以使用refreshControl或提供的相关属性实现类似于scrollview的pull-to-refresh.

Demo

实例项目: https://github.com/greatbsky/react-native-pullview-demo

使用方法

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

  2. 编写代码:

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

更多配置项

下拉效果属性

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

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

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

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

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

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


普通refreshcontrol相关属性
  • onRefresh: 开始刷新时调用的方法

  • refreshing: 指示是否正在刷新

本文地址:https://www.codercto.com/soft/d/4554.html

What Technology Wants

What Technology Wants

Kevin Kelly / Penguin Group (USA) Incorporated / 2010-10-14 / USD 27.95

A refreshing view of technology as a living force in the world. This provocative book introduces a brand-new view of technology. It suggests that technology as a whole is not a jumble of wires and ......一起来看看 《What Technology Wants》 这本书的介绍吧!

随机密码生成器
随机密码生成器

多种字符组合密码

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具