react-native-pullview [](<a href="https://github.com/greatbsky/react-native-">https://github.com/greatbsky/react-native-</a>[](<a href="https://github.com/greatbsky/react-native-" 介绍
这是一个实现下拉刷新的react native组件,可支持android & ios,简单易用!
纯js代码,基于ScrollView封装. 比scrollview更强大,有三个下拉状态: pulling, pullok, pullrelease.
还可以使用refreshControl或提供的相关属性实现类似于scrollview的pull-to-refresh.
Demo
实例项目: https://github.com/greatbsky/react-native-pullview-demo
[](https://github.com/greatbsky/react-native-
pullview/wiki#%E4%BD%BF%E7%94%A8%E6%96%B9%E6%B3%95)使用方法
-
执行npm install react-native-pullview –save
-
编写代码:
import PullView from 'react-native-pullview';
onPullRelease(resolve) {
//do something
resolve();
}
//sth… -
完整代码: https://github.com/greatbsky/react-native-pullview-demo
[](https://github.com/greatbsky/react-native-
pullview/wiki#%E6%9B%B4%E5%A4%9A%E9%85%8D%E7%BD%AE%E9%A1%B9)更多配置项
下拉效果属性
-
onPulling: 处于pulling状态时执行的方法
-
onPullOk: 处于pullok状态时执行的方法
-
onPullRelease: 处于pullrelease状态时执行的方法
-
topIndicatorRender: 顶部刷新指示组件的渲染方法, 接受三个参数: ispulling, ispullok, ispullrelease
-
topIndicatorHeight: 顶部刷新指示组件的高度, 若定义了topIndicatorRender则同时需要此属性
-
isPullEnd: 是否已经下拉结束,若为true则隐藏顶部刷新指示组件,非必须
普通refreshcontrol相关属性
-
onRefresh: 开始刷新时调用的方法
-
refreshing: 指示是否正在刷新
react-native-pullview [](<a href="https://github.com/greatbsky/react-native-">https://github.com/greatbsky/react-native-</a>[](<a href="https://github.com/greatbsky/react-native-" 官网
https://github.com/greatbsky/react-native-pullview
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。