1 /**2 * Created by Daguo on 2016/4/7.3 */4 5' Use strict '6 7 Import react,{8 Component,9 View,Ten Text, One ListView, A -} from ' React-native '; - the class Listviewdemo extends Component { - Constructor (props) { - super (props); -Let ds=NewListview.datasource ({rowhaschanged: (R1,R2) = r1!=R2}); + This. state={ -DataSoure:ds.cloneWithRows ([' Row1 ', ' row2 ']),//returned is also a ListView + }; A } at Componentwillmount () { - - } - Componentdidmount () { - //This allows the data to be loaded asynchronously or settimeout (); - } in _renderrow (rowdata) { - to } + render () { - return ( the<ListView *datasource={ This. State.datasource} $renderrow={ This. _renderrow (RowData)}Panax Notoginsenginitiallistsize={300} -Onchangevisiblerows={} theOnendreached={} +Onendreachedthreshold={} APagesize={} theRemoveclippedsubviews={{overflow: "Hidden"}} +renderfooter={() =renderable} -Renderheader={} $Renderscrollcomponent ={(props) =renderable} $Rendersectionheader = {} -Renderseparator= {} -Scrollrenderaheaddistance ={} the> - Wuyi</ListView> the ); - } Wu -}
View Code
RN Components of the ListView