【发布时间】:2016-12-23 07:29:05
【问题描述】:
我在 react native 中使用列表视图 onEndReached 组件时遇到了一些问题。
渲染代码:
@autobind
_fetchMoreHistory(){
console.log("Fetch more history called");
}
<View style={[styles.Ctr]}>
<ListView dataSource={this.state.txHistorySource}
renderRow={ this._renderRow }
onEndReached ={ this._fetchMoreHistory }
onEndReachedThreshold = {10}/>
</View>
我打开屏幕的那一刻_fetchMoreHistory 被调用了两次并且在onEndReached 到达之后正常工作。有人可以帮忙调试吗?
【问题讨论】:
-
您要获取多少行? onEndReached 在行的渲染结束时执行,因此您将限制设置为 10,我认为您只有 10 多行。有可能吗?
标签: javascript reactjs react-native