Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native: How to disable scrolling in ListView?

Tags:

react-native

Is it possible to disable scrolling of ListView? I've tried noScroll:

<ListView noScroll={true}> </ListView> 

But it doesn't seem to make any difference.

like image 534
skyline75489 Avatar asked Jun 04 '15 13:06

skyline75489


People also ask

How do I disable scroll in React Native?

To enable or disable scrolling on FlatList with React Native, we can set the scrollEnabled prop. to set the scrollEnabled prop to false to disable scrolling on the FlatList.

How do I get rid of FlatList scrollable React Native?

Conclusion. To hide the scrollbar in a FlatList with React Native in Android, we can set the showsVerticalScrollIndicator and showsHorizontalScrollIndicator props to false .

How do I use scrollTo in React Native?

To scroll to top of the ScrollView with React Native, we assign a ref to the ScrollView and call scrollTo on the ref's value. to create a ref with useRef and set that as the value of the ref prop of the ScrollView . Then we add a Button that calls ref. current.

What is contentContainerStyle?

ScrollView contentContainerStyle defines the inner container of it, e.g items alignments, padding, etc. Follow this answer to receive notifications.


2 Answers

i think it should be

scrollEnabled={false} 

http://facebook.github.io/react-native/docs/scrollview.html#props

like image 131
boredgames Avatar answered Sep 18 '22 01:09

boredgames


Sometimes scrolling is disabled only by applying both scrollEnabled and nestedScrollEnabled:

<ScrollView   scrollEnabled={false}   nestedScrollEnabled={false} >   {children} </ScrollView> 
like image 37
Roman Avatar answered Sep 18 '22 01:09

Roman