React Native RefreshableListView
A awesome pull-down-refresh and pull-up-loadmore listview
Installation
npm install react-native-refresh-infinite-listview --save
Usage
Example
'use strict'; var React = ;var View Text StyleSheet ListView = React; var TimerMixin = ;var RefreshInfiniteListView = ; var ds = r1 !== r2;moduleexports = React; var styles = StyleSheet;
Screencasts
Props
footerHeight:number
if you need use infinite with custom, must set footerHeightpullDistance:number
set pull distance, default is 50renderEmptyRow:func
{ return <View style=height:Dimensionsheight justifyContent:'center'alignItems:'center'> <Text style=fontSize:40 fontWeight:'800' color:'red'> have no data </Text> </View> }
renderHeaderRefreshIdle:func
{return <View style=flex:1 height:DEFAULT_HF_HEIGHT justifyContent:'center' alignItems:'center'> <Text style=stylestext> pull down refresh... </Text> <Image source= resizeMode=ImageresizeModestretch style=stylesimage /> </View> }
renderHeaderWillRefresh:func
{return <View style=height:DEFAULT_HF_HEIGHT justifyContent:'center' alignItems:'center'> <Text style=stylestext> release to refresh... </Text> <Image source= resizeMode=ImageresizeModestretch style=stylesimage stylesimageRotate /> </View> }
renderHeaderRefreshing:func
{return <View style=height:DEFAULT_HF_HEIGHT justifyContent:'center' alignItems:'center'> <Text style=stylestext> refreshing... </Text> <ActivityIndicatorIOS size='small' animating=true/> </View> }
renderHeaderRefreshing:func
{return <View style=height:DEFAULT_HF_HEIGHT justifyContent:'center' alignItems:'center'> <Image source= resizeMode=ImageresizeModestretch style=stylesimage stylesimageRotate /> <Text style=stylestext> pull up to load more... </Text> </View> }
renderFooterWillInifite:func
{return <View style=height:DEFAULT_HF_HEIGHT justifyContent:'center' alignItems:'center'> <Image source= resizeMode=ImageresizeModestretch style=stylesimage /> <Text style=stylestext> release to load more... </Text> </View> }
renderFooterInifiting:func
{return <View style=height:DEFAULT_HF_HEIGHT justifyContent:'center' alignItems:'center'> <ActivityIndicatorIOS size='small' animating=true/> <Text style=stylestext> loading... </Text> </View> }
renderFooterInifiteLoadedAll:func
{ return <View style=height:DEFAULT_HF_HEIGHT justifyContent:'center' alignItems:'center'> <Text style=stylestext> have loaded all data </Text> </View> }
onRefresh:func
{ console; }
onInfinite':func
{ console; }
loadedAllData':func
{ return false; }