Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

How to scroll down a specific value in react native?

$
0
0

I would like to scroll to an element that is y unit under my touchableopacity(when I press on it). I tried using ref and useref but it was not what I wanted. Is it possible to scroll down a specific length when you press on a button?Here is some code to illustrate :

return (<View><Text                      onPress={() => {                          idData = data.id;                          totalid++; // here is the total, the length                           //that I want to scroll down                          alert("mon id est: " + idData);                          viewRef.current?.focus();                        }                      }}>                      {Data.name}</Text></View>

and somewhere bellow:

<View ref={viewRef}>

Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>