onEndReachedThreshold在react-native中实际上意味着什么 [英] what onEndReachedThreshold really means in react-native

查看:800
本文介绍了onEndReachedThreshold在react-native中实际上意味着什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

来自文档:

onEndReachedThreshold编号

onEndReachedThreshold number

调用onEndReached的阈值(虚拟,不是物理). 所以我只想知道它是什么意思,它是从顶部开始的阈值,还是从底部开始的阈值.

Threshold in pixels (virtual, not physical) for calling onEndReached. so I just wanted to know what it means, is it threshold from the top, or is it threshold from the bottom.

从顶部开始? -如果我将onEndReachedThreshold = {10}设置为一个值,那么当我滚动到10像素或其他像素时,是否会立即调用我的onEndReached.

From the top? - if I set a value of onEndReachedThreshold ={10}, is my onEndReached called as soon as I scrolled to 10 pixel, or something else.

从底部开始? -如果我将onEndReachedThreshold的值设置为{listview height -10},那么当我滚动到10像素或其他像素时,onEndReached会立即被调用.

From the bottom? - if I set value of onEndReachedThreshold ={listview height -10}, will my onEndReached called as soon as I scrolled to 10 pixel, or something else.

推荐答案

文档始终是最好的选择:

onEndReached函数
当所有行都已呈现并且列表已滚动到底部的onEndReachedThreshold 中时调用.提供了本机滚动事件.

onEndReached function
Called when all rows have been rendered and the list has been scrolled to within onEndReachedThreshold of the bottom. The native scroll event is provided.

onEndReachedThreshold编号
以像素为单位的阈值(虚拟的,不是物理的),用于调用onEndReached.

onEndReachedThreshold number
Threshold in pixels (virtual, not physical) for calling onEndReached.

据我所见: 如果您执行onEndReachedThreshold ={10},则从底部滚动到10像素会调用onEndReached

So as I see it: if you do onEndReachedThreshold ={10} it calls onEndReached if you scrolled to 10 pixels from the bottom

这篇关于onEndReachedThreshold在react-native中实际上意味着什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆