【发布时间】:2016-07-22 16:30:49
【问题描述】:
由于某种我不明白的原因,我的 ListView 一直在触发,即使它位于滚动的顶部,我需要将它包装在 ScrollView 中,因为我希望我的 ToolBar 在用户在 ListView 中向下滚动时隐藏也是。
这是 render() 方法的内容:
<ScrollView>
<ActivityContainer>
<ListView
onEndReachedThreshold={100}
pageSize={10}
initialListSize={20}
onEndReached={() => {
console.log("fired"); // keeps firing
}}
enableEmptySections={true}/>
</ActivityContainer>
</ScrollView>
还尝试将整个事物包装在这样的视图中:
<ScrollView>
<View>
<ActivityContainer>
<ListView
onEndReachedThreshold={100}
pageSize={10}
initialListSize={20}
onEndReached={() => {
console.log("fired"); // keeps firing
}}
enableEmptySections={true}/>
</ActivityContainer>
</View>
</ScrollView>
编辑:我不需要 renderHeader,因为我试图滚动浏览 ListView 顶部的所有内容,它有许多组件和视图以及子视图,而不是列表视图的标题。
【问题讨论】:
标签: listview react-native ecmascript-6