【发布时间】:2021-01-05 13:46:57
【问题描述】:
我有一个要求,个人资料数据将位于顶部,而提要将在其后出现。在滚动提要时,配置文件部分也应该滚动。表示整个页面需要滚动。
所以我在 ScrollView 中实现了 FlatList。
<ScrollView
contentContainerStyle={{ flex: 1 }}>
<FlatList
showsVerticalScrollIndicator={false}
showsHorizontalScrollIndicator={false}
data={this.state.feed}
keyExtractor={(item, index) => item.id}
refreshControl={this.refreshControl()}
renderItem={({ item, index }) => this.renderItem(item, index)}
numColumns={2}
ListFooterComponent={this.renderFooter.bind(this)}
onEndReachedThreshold={0.4}
onEndReached={this.handleLoadMore.bind(this)} />
</ScrollView>
但我无法滚动页面。
如果我删除 contentContainerStyle={{ flex: 1 }},那么 handleLoadMore 函数会不断地调用自己。
感谢您的任何建议!
【问题讨论】:
标签: react-native scrollview react-native-flatlist nestedscrollview