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?