<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>在上面的列表视图中,由于列表项数量较多,onPress ListItem事件需要2-5秒才能触发。
用更少的列表标题,它是有效的,在30多个列表标题上的问题
如何解决这个问题,分页是否有用?
发布于 2018-01-17 20:26:36
对于更长的列表,你应该使用FlatList -它通过只渲染屏幕上实际显示的内容来优化渲染。
https://stackoverflow.com/questions/48298178
复制相似问题