React native 如何使RN中的反向平面列表的加载指示器保持在顶部
当平面列表反转时,加载指示器将位于底部,如何将其保持在顶部?我最后使用了一种变通方法,将平面列表包装在ScrollView中,并将refreshControl保留在ScrollView中React native 如何使RN中的反向平面列表的加载指示器保持在顶部,react-native,react-native-flatlist,React Native,React Native Flatlist,当平面列表反转时,加载指示器将位于底部,如何将其保持在顶部?我最后使用了一种变通方法,将平面列表包装在ScrollView中,并将refreshControl保留在ScrollView中 const { fetchingMore, onFetchMore } = this.props; return <ScrollView contentContainerStyle={{ flexDirection: 'row', alignSelf: 'flex-end',
const { fetchingMore, onFetchMore } = this.props;
return <ScrollView
contentContainerStyle={{
flexDirection: 'row',
alignSelf: 'flex-end',
flexGrow: 1
}}
refreshControl={<RefreshControl refreshing={fetchingMore} onRefresh={onFetchMore} />}
>
<FlatList
inverted
style={styles.list}
data={messages}
keyExtractor={this.extractItemKey}
renderItem={this.renderItem}
/>
</ScrollView>
请注意,在scrollView中使用flexGrow:1样式非常重要,否则当它未满时,平面列表将在scrollView的顶部流动。我相信这可能会在android中由于嵌套滚动组件的使用而产生问题。scrollEnabled={false}没有必要吗?嗨@surajmalviya谢谢你的信息,我还没有在Android上测试它,一旦有机会,我会尝试一下,然后再联系你。