Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable elastic scrolling inside a listview - react-native

Tags:

react-native

I'm trying to disable the elastic scrolling on top of the list view. I'd like to have the upper edge of the picture "stuck" to the status bar. Is that possible?

http://imgur.com/a/ULzxE

like image 952
Marco Caldera Avatar asked May 15 '17 12:05

Marco Caldera


People also ask

How do you disable scroll of view in react native?

We would use showsVerticalScrollIndicator={false} prop to disable the Scroll bar in scroll view component.

How do you autoscroll in react native?

Auto scroll is provided out of the box by react native. The ScrollView component by react native has props to scroll to the desired co-ordinates on the screen. There are two such props in ScrollView: ScrollTo(): takes the x and y offset coordinates and scrolls to that position.

What is contentContainerStyle?

contentContainerStyle: It is used to style the content of the ScrollView containers. contentInset: This property is used to inset the scroll view content by a specific amount. contentInsetAdjustmentBehavior: This property is used to identify how the safe area insets are used to modify the content area of the ScrollView ...

What is scrollEventThrottle?

scrollEventThrottle If you do not need precise scroll position tracking, set this value higher to limit the information being sent across the bridge. The default value is 0 , which results in the scroll event being sent only once each time the view is scrolled. Type. Default. number.


1 Answers

Yes and no - it's possible for iOS where elastic behaviour is present. Check property bounces (boolean): https://reactnative.dev/docs/scrollview#bounces-ios

Although it's under ScrollView, this property is inherited by ListView as well.

like image 143
Samuli Hakoniemi Avatar answered Sep 19 '22 13:09

Samuli Hakoniemi