简体   繁体   English

从底部功能反应本机平面列表拉取

[英]React native flatlist pull from bottom functionality

I know how to implement a "pull to refresh" from the top of the list functionality using the onRefresh prop,is there a way to do something similar for the bottom end of the list,so when i "pull" from the bottom would trigger a function?我知道如何使用onRefresh道具从列表顶部实现“拉动刷新”功能,有没有办法对列表的底端做类似的事情,所以当我从底部“拉动”时会触发function?

The onEndReached prop does'nt really work as i would like,since it runs a function everytime you reach the end of the list,i dont want that,i want nothing to run unless i "pull" from the bottom. onEndReached道具并没有像我希望的那样真正工作,因为每次你到达列表末尾时它都会运行 function,我不想要那个,我不想运行任何东西,除非我从底部“拉”出来。

I tried to invert the flatlist using the invert prop,which makes use of the onRefresh prop when pulling from the bottom(its upside down),and it works perfectly,but i want to have them both.我尝试使用invert道具反转平面列表,它在从底部拉动时使用了onRefresh道具(颠倒),并且效果很好,但我想同时拥有它们。

Any ideas?有任何想法吗?

Found it,i just added a negative value to onEndReachedThreshold prop,so onEndReachedThreshold={-0.5} will run the onEndReached function when "pulling" to as much as half of the flatlist height.找到它,我只是在onEndReachedThreshold道具上添加了一个负值,所以onEndReachedThreshold={-0.5}将在“拉”到 flatlist 高度的一半时运行onEndReached function。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在React Native的FlatList中,如何在顶部(同时)在底部使用“拉动刷新”? - How to use “Pull to refresh” in top and (at the same time) in bottom in a FlatList in React Native? React Native,如何用FlatList实现pull to refresh? - React Native, how to implement pull to refresh with FlatList? React Native Flatlist 在上拉时不刷新数据 - React Native Flatlist not refreshing data on pull up React Native - FlatList无法到达底部 - React Native - FlatList unable to reach bottom React Native 中的 FlatList 实现 - renderItem 功能不清楚? - 未定义的属性 - FlatList implementation in React Native - renderItem functionality unclear? - undefined property React 中 React Native 的 FlatList 等价物 - Equivalent of FlatList from React Native in React 在响应本机的新闻平面列表项上更改边框底部 - border bottom changing on press flatlist item in react native 删除 React Native 中每个 ListItem/Flatlist 行底部的多余空格? - Remove bottom extra spaces on each ListItem/Flatlist rows in React Native? 当我们到达列表底部时,React Native FlatList 加载更多 - React Native FlatList load more when we get to the bottom of the list 如何在 React Native 中滚动到末尾时将按钮保留在平面列表的底部? - How to keep button at the bottom of flatlist while scrolling to the end in React Native?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM