Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ignore touch on absolute positioned view to allow scroll on underlying ScrollView

Tags:

react-native

I have a View that is absolute positioned above a ScrollView:

enter image description here

I want to be able to scroll even though I start my touch inside the top view. I have tried setting onStartShouldSetResponder and onMoveShouldSetResponder on the View to false but it still doesnt allow me to scroll the underlying ScrollView. Any help is appreciated :)

like image 965
David Avatar asked Apr 25 '16 15:04

David


People also ask

How do you scroll with an absolute position?

You need to wrap the text in a div element and include the absolutely positioned element inside of it. Setting the inner div's position to relative makes the absolutely position elements inside of it base their position and height on it rather than on the . container div, which has a fixed height.

What is KeyboardAwareScrollView?

By using KeyboardAwareScrollView , your entire screen becomes scrollable. Furthermore, it automatically handles input field focus and lifts the field upward upon opening the keyboard.

Why ScrollView is not scrolling in react native?

To fix ScrollView Not scrolling with React Native, we wrap the content of the ScrollView with the ScrollView. to wrap ScrollView around the Text components that we render inside. As a result, we should see text inside and we can scroll up and down.

Can scroll in ScrollView react native?

ScrollViews can be configured to allow paging through views using swiping gestures by using the pagingEnabled props. Swiping horizontally between views can also be implemented on Android using the ViewPager component. On iOS a ScrollView with a single item can be used to allow the user to zoom content.


Video Answer


1 Answers

If anyone is having this issue it is now possible to add pointerEvents="none" to the View you don't want to respond to touch. See the documentation here.

like image 185
David Avatar answered Oct 27 '22 16:10

David