Is there a way to scroll based on offset rather than scrollToLocation for a Section List?
Currently, it only allows the scrolling to a specific section/index.
Also would there be a clever way to control the speed of the scrolling animation?
Related
I'm using a ScrollView for my app onboarding (horizontal scrolling/swiping).
How can I reduce the amount of swipe needed to move to the next page? (with pagingEnabled).
I want the user to be able to scroll with shorter swipe lengths rather than having to drag a lot to one side or the other.
And if I don't use pagingEnabled and instead use snapToInterval/Alignment and decelerationRate, I have this issue where the user can scroll multiple pages at once.
I need a ListView or Table or any other custom component that can have infinite scrolling in both horizontal and vertical directions. For example, 10,000 rows and 10,000 columns. We have the react-native's FlatList component but it can be used for either vertical or horizontal but not for both. If the data is finite, we can go with implementing a vertical scrollView inside a horizontal scrollView or vice-versa. But as we are looking for infinite scrolling, we are not able to use scrollView as it tries to load the entire content when the app is opened and the memory consumption is very huge so that the app automatically crashes. Does anyone have any idea if there are any third party libraries that can scroll both vertically and horizontally and also can look after the performance? Actually, is that possible to build such a component on our own in react-native? If so, please tell me if you have any ideas.
I am trying to understand how can I set a threshold for the RN ScrollView.
This is because if you have multiple vertical scrollable View in a horizontal ScrollView then the scrolling of the Views is very difficult.
So i just need something that holds the horizontal scrolling until the finger swipe horizontally for a certain pixel-span.
Has anyone a clue about how to archive this?
You can use the native scroll event in onScrollEnd to get the velocity of the scroll, then only scroll horizontally if it's past a certain amount. On most vertical/horizontal scrolls, most users only scroll in one direction. If you truly want to implement a distance based scroll, you would need to attach a PanResponder to your component and compare the distnaces of the Grant and Release events.
I am trying to build a component to detect a pulldown on a scrollview. Pulldown being when you try to refresh facebook or twitter feeds.
So my approach was trying to use the onScroll method to detect the changes from scroll view.
onScroll={this.handleScroll}
handleScroll(event) {
console.log(event.nativeEvent.contentOffset.y);
}
However, what I found is when you are scrolling downward (like you are scrolling through a facebook or twitter feed), it will give you the value of the offset.
I then tried to emulate the 'pulldown' behavior where I would scroll in the opposite direction. The difficulty is when the scroll view reaches 0, I can't detect any decrease in scroll. Does that make sense? Basically how I can detect a pulldown when the scroll view is at 0.
You can use RefreshControl to achieve this
I want ScrollView to scroll more fast because it take 1sec time to scroll end even if it scroll little distance.
Does ScrollView have a option of change scroll speed?
or Do I have a another way?
sorry, but the office doc does not support changing scroll speed of ScrollView component. if you need, you can try to write a new native scrollView.