-
Notifications
You must be signed in to change notification settings - Fork 0
listView
brainpoint edited this page Mar 2, 2017
·
1 revision
'use strict';
import React, { Component } from 'react';
import { AppRegistry, StyleSheet, } from 'react-native';
import { RefreshListView, RefreshScrollView } from 'react-componet'
class app extends Component {
render() {
return (
<ListView
dataSource={ds}
renderHeader={this.renderHeader}
renderRow={(rowData) =>
<ProductCell url={rowData.url} desc={rowData.desc} price={rowData.price} price_v={rowData.price_v} stock={utils_string.format_number(rowData.stock)} price_src={rowData.price_src}/>
}
onPulling={(resolve)=>resolve()}
onPullOk={(resolve)=>resolve()}
onPullRelease={(resolve)=>resolve()}
topIndicatorRender={(pulling, pullok, pullrelease) =>
<View style={{flex: 1, flexDirection: 'row', justifyContent: 'center', alignItems: 'center', height: 60}}>
<ActivityIndicator size="small" color="gray" />
{pulling ? <Text>下拉刷新pulling...</Text> : null}
{pullok ? <Text>松开刷新pullok......</Text> : null}
{pullrelease ? <Text>玩命刷新中pullrelease......</Text> : null}
</View>
}
topIndicatorHeight={60}
/>
);
}
}当下拉时的处理函数.
当下拉完成时的处理函数.
当释放时的处理函数. 调用resolve() 之后将完成更新.
自定义提示内容
自定义提示内容的高度.
移到顶部
移到底部