简体   繁体   中英

pagination in react native listview

<List dataArray={ComplaintStore.listdata.slice()} renderRow={(data)=>((data.length!=0)?
  <ListItem onPress={()=>this.onSelectComplaint(data)}>
    <View style={{flex:1,flexDirection: 'row'}}>
      <Text style={{color: 'black',fontSize:fsize}}>{data.id}</Text>
      <Text style={{color: 'black',fontSize:fsize}}>Type:{data.type}</Text>
      <Text style={{color: 'black',fontSize:fsize}}>Sub Type:{data.priority}</Text>
      <Text style={{marginRight:30,color: 'black',fontSize:fsize}}>{data.statusname}</Text>
    </View>
    </View>
  </ListItem>
  :
  <View></View>)}>
</List>

In the above listview ,due to more amount of list items onPress ListItem event takes 2-5 sec to trigger.

With Less listitems it is effective, problem on more than 30 listitems

How to resolve it , is pagination is helpfull?....

对于更长的列表,您应该使用FlatList它通过仅渲染屏幕上实际显示的内容来优化渲染。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM