I have used Scrollview in my screen and when I log y offset I get negative values?
How can I disable Scrollview bouncing?
I have used Scrollview in my screen and when I log y offset I get negative values?
How can I disable Scrollview bouncing?
This code should worked:
<ScrollView
alwaysBounceHorizontal={false}
alwaysBounceVertical={false}
bounces={false}
/>
The answers given by others only solve the issue for iOS, but for Android, the issue still persists.
Here is the final solution I found after some digging.
Solution for iOS: (https://reactnative.dev/docs/scrollview#bounces-ios)
<ScrollView
alwaysBounceHorizontal={false}
alwaysBounceVertical={false}
bounces={false}
/>
Solution for Android: (https://reactnative.dev/docs/scrollview#overscrollmode-android)
<ScrollView
overScrollMode="never"
/>
There are props called alwaysBounceVertical
. Set it to false.
<ScrollView
alwaysBounceVertical={false}
/>
Here is doc.