码迷,mamicode.com
首页 > 其他好文 > 详细

RN组件之ListView

时间:2016-04-07 13:26:06      阅读:152      评论:0      收藏:0      [点我收藏+]

标签:

技术分享
 1 /**
 2  * Created by DaGuo on 2016/4/7.
 3  */
 4 
 5 ‘use strict‘
 6 
 7 import React,{
 8     Component,
 9     View,
10     Text,
11     ListView,
12 
13 } from ‘react-native‘;
14 
15 class ListViewDemo extends Component {
16     constructor (props){
17         super(props);
18         let ds=new ListView.DataSource({rowHasChanged:(r1,r2) => r1!=r2});
19         this.state={
20             dataSoure:ds.cloneWithRows([‘row1‘,‘row2‘]),//返回的也是一个ListView
21         };
22     }
23     componentWillMount (){
24 
25     }
26     componentDidMount (){
27          //这里可以异步加载数据或者setTimeout();
28     }
29     _renderRow (rowData){
30 
31     }
32     render (){
33         return (
34            <ListView
35                 dataSource={this.state.dataSource}
36                 renderRow={this._renderRow(rowData)}
37                 initialListSize={300}
38                 onChangeVisibleRows={}
39                 onEndReached={}
40                 onEndReachedThreshold={}
41                 pageSize={}
42                 removeClippedSubViews={{overflow:"hidden"}}
43                 renderFooter={() => renderable}
44                 renderHeader={}
45                 renderScrollComponent ={(props) => renderable}
46                 renderSectionHeader = {}
47                 renderSeparator= {}
48                 scrollRenderAheadDistance ={}
49            >
50 
51            </ListView>
52         );
53     }
54 
55 }
View Code

 

RN组件之ListView

标签:

原文地址:http://www.cnblogs.com/ZSG-DoBestMe/p/5362973.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!