/**
* Created by DaGuo on 2016/4/7.
*/ 'use strict' import React,{
Component,
View,
Text,
ListView, } from 'react-native'; class ListViewDemo extends Component {
constructor (props){
super(props);
let ds=new ListView.DataSource({rowHasChanged:(r1,r2) => r1!=r2});
this.state={
dataSoure:ds.cloneWithRows(['row1','row2']),//返回的也是一个ListView
};
}
componentWillMount (){ }
componentDidMount (){
//这里可以异步加载数据或者setTimeout();
}
_renderRow (rowData){ }
render (){
return (
<ListView
dataSource={this.state.dataSource}
renderRow={this._renderRow(rowData)}
initialListSize={300}
onChangeVisibleRows={}
onEndReached={}
onEndReachedThreshold={}
pageSize={}
removeClippedSubViews={{overflow:"hidden"}}
renderFooter={() => renderable}
renderHeader={}
renderScrollComponent ={(props) => renderable}
renderSectionHeader = {}
renderSeparator= {}
scrollRenderAheadDistance ={}
> </ListView>
);
} }