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

cannot get negative content offset of android in react native?

$
0
0

new to scrolling on react native and this is my function which works well on ios:

  const onScroll = (e) => {    var offset_y = e.nativeEvent.contentOffset.y;    console.log('offset_y ', e.nativeEvent);    if (offset_y > 0) {      if (height >= 0) {        setHeight(height - offset_y);      }    }    if (offset_y < 0) {      if (height <= defaultHeight) {        setHeight(height - offset_y);      }    }  };

The problem on android is it cannot get negative offset, how can i calculate that in rn?


Viewing all articles
Browse latest Browse all 16750

Trending Articles



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