注意:可以不拷贝ECListViewTest.js 因为这是可运行测试页面
import React, {Component} from 'react';
import {
Text,
View
} from 'react-native';
import ECListView from './ECListView'
render() {
if (this.state.data) {
return <ECListView enableRefresh={true} // 是否使用刷新
enableLoadMore={true} // 是否使用加载更多
dataSource={this.state.data} // 数据源 数组形式[]
renderRow={(rowData) => this._renderRow(rowData)} // 每一行的布局
onRefresh={() => this._refresh()} // 刷新监听
onLoading={() => this._loading()} // 加载更多监听
/>
} else {
return (<View/>)
}
}
name | value | desc |
---|---|---|
enableRefresh | true / false | 是否使用刷新 |
enableLoadMore | true / false | 是否使用加载更多 |
dataSource | [] | 数据源 数组形式[] |
renderRow | View | 每一行的布局需要返回View |
onRefresh | () | 刷新监听 |
onLoading | () | 加载更多监听 |
欢迎大家使用ECListView 如有问题请到 issues 提交