Javascript 用很少的元素处理本机无限滚动问题
我将React Native与Firebase一起使用,并且我尝试在我的Listview上使用无限滚动(加载更多),如果第一次获取可以填充整个屏幕高度的列表,则一切正常,因为OneDreached被激发,但当屏幕上的元素很少且Listview根本没有填充时,OneDreached未被激发,因此它不会下载并填充下一条记录。有人能帮我处理这种情况吗? 提前谢谢Javascript 用很少的元素处理本机无限滚动问题,javascript,firebase,react-native,infinite-scroll,Javascript,Firebase,React Native,Infinite Scroll,我将React Native与Firebase一起使用,并且我尝试在我的Listview上使用无限滚动(加载更多),如果第一次获取可以填充整个屏幕高度的列表,则一切正常,因为OneDreached被激发,但当屏幕上的元素很少且Listview根本没有填充时,OneDreached未被激发,因此它不会下载并填充下一条记录。有人能帮我处理这种情况吗? 提前谢谢 return ( <View style={{flex:1}}> <ListV
return (
<View style={{flex:1}}>
<ListView
dataSource={this.state.userDataSource}
renderRow={this.renderRow.bind(this)}
style={{paddingTop: 10, paddingBottom: 10}}
enableEmptySections={true}
renderFooter={this.renderFooter.bind(this)}
onEndReached={this.infScrollFetch.bind(this)}
onEndReachedThreshold={0.1}
refreshControl={
<RefreshControl
refreshing={this.state.refreshing}
onRefresh={this._onRefresh.bind(this)}
title="Pull to refresh" tintColor="#fff" titleColor="#fff" colors={["#FEC200"]}
/>
}
/>
</View>
);
返回(
);
在componentDidMount()上调用第一个fetch()Try use->它是无限列表的最佳元素。(它对onEndReachedThreshold也有不同的机制)它有效,我没有得到这两个onEndReachedThreshold之间的区别。谢谢你的帮助!