react-native-parallax-scroll-view
react-native-parallax-scroll-view copied to clipboard
onEndReached not getting called for ListView
Hey,
I'm using a ParallaxScrollView inside the renderScrollComponent of the ListView on ReactNative-Android . I've implemented onEndReached on the ListView to make sure more items are fetched as soon as the item list is about to end. But as soon as I add ParallaxScrollView in the renderScrollComponent, it renders only the first fold of items and never queries for more items. Can somebody help on this? I'm currently using React Native 0.30.0. @jaysoo
Same problem here. is it really the problem?
Anybody working on it??? @jaysoo ?. 25 days have been passed. i am stuck with development. any other library which will help? @muskeinsingh what did you use?
@waleedarshad-vf I kind of developed a way of my own. I started listening to the scrollListener on the Listview and Animated my View using a transform. I didn't use the ParallaxScrollView in my renderScrollComponent since it was only causing more problems than it was helping. @jaysoo any help on this would be appreciated since what I did doesn't seem to be a clean solution. It's more of a hack around this.
@muskeinsingh for the time being can you share sample code from you solution which works or any other solution you suggest?
@muskeinsingh ? need your help
@alaycock how can i used onReachEnd? can you help me?
@jaysoo would you please advise?
Use this prop for ListView : onScroll:this.handleScroll. HandleScroll looks like this. handleScroll(event:Object){ this.scrollPostion = event.nativeEvent.contentOffset.y; } It should return you the scrollPosition and then you can animate the view based on this. Hope this helps!
Thanks @muskeinsingh this resolved the problem. I was suffering from this issue from last 27 days finally resolved it with your help. Thanks again. :)
Sure thing. @waleedarshad-vf @jaysoo can we get some generic solution here?
@muskeinsingh #60 fixed the issue for us
Taking a look.
Fixed with:
On handleScroll:
_onScrollHandled(e) {
const scrollOffset = e.nativeEvent.layoutMeasurement.height + e.nativeEvent.contentOffset.y
const scrollHeight = e.nativeEvent.contentSize.height
if(scrollOffset == scrollHeight) {
this.scrollIsFetching = true
this._onEndReached()
}
And in ParallaxScrollView
<ParallaxScrollView
onScroll={ (e) => this._onScrollHandled(e) }
PD: Last version published on npm is 0.19.0, not 0.20.1
Now increase the size of list, but scroll component or listview dont render the new items. The list size change, but nothing happens. If i remove ParallaxScrollView from renderScrollComponent listView prop all works fine. Some help @jaysoo
@muskeinsingh any update about this? I can fix onEndReached, but i cant fix the bug with re-render with more list results
Ok, i think is height problem. I load 30 items on first render and list only render the 10 first items... @muskeinsingh can you help me to fix it?
Ok, i think is height problem. I load 30 items on first render and list only render the 10 first items... @muskeinsingh can you help me to fix it?
same problem, list only render 10 items
https://stackoverflow.com/questions/40706450/why-is-this-listview-only-showing-10-items
fixed for me =,=