React native 平面列表中的渲染问题
我使用平面列表作为无限滚动,滚动的每一项都是一个旋转木马,就像hotstar/prime视频一样。每个转盘中至少可以有8-10个图像 无限卷轴的渲染几乎没有问题React native 平面列表中的渲染问题,react-native,react-native-flatlist,react-virtualized,React Native,React Native Flatlist,React Virtualized,我使用平面列表作为无限滚动,滚动的每一项都是一个旋转木马,就像hotstar/prime视频一样。每个转盘中至少可以有8-10个图像 无限卷轴的渲染几乎没有问题 有时,当我滚动得更快时,滚动会形成空白,但有时会被填满。它看起来滚动和渲染速度很大 不同。它发生在滚动的两个方向 滚动时,触摸事件在单击时没有响应 此外,当添加新数据以滚动时,渲染速度会非常慢 我已经尝试了所有在官方文档中建议的优化,但是问题1和3对于用户来说仍然是一个错误的体验 return ( <FlatLis
return (
<FlatList
style={Style.container}
data={props.data}
keyExtractor={getKeyExtractor(props.keyExtractor)}
renderItem={getRenderItem(props.renderItem)}
onEndReached={getLoadMore(props.loadMore)}
onEndReachedThreshold={0.6}
removeClippedSubviews={true}
maxToRenderPerBatch={1}
updateCellsBatchingPeriod={1}
showsVerticalScrollIndicator={false}
onRefresh={getRefresh(isRefreshing, setIsRefreshing, props.refresh)}
initialNumToRender={1}
refreshing={isRefreshing}
horizontal={props.horizontal}
numColumns={1}
ListHeaderComponent={props.renderHeader}
stickyHeaderIndices={[0]}
windowSize={8}
ref={getRef(props.reference)}
/>
);
返回(
);