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

React Native onLayout nativeEvent.layout.y always returns 0

$
0
0

I'm creating a grid of Views. I'm doing it using pure flex. i.e. no absolute positioning. Actual screenshot:

Actual screenshot

I need to know the positions of each View in the grid and for that I'm using the onLayout prop.The problem is that the y value on evt.nativeEvent.layout is always zero, the rest of the values (x, height, width) are fine.I'm testing only in Android, using Genymotion and a physical Sony Xperia device (both with Android 6.0.1).

Any ideas of why the y value is 0?

React Native version: react-native: 0.40.0, react-native-cli: 1.2.0

Thanks for your help.


Viewing all articles
Browse latest Browse all 29768

Latest Images

Trending Articles



Latest Images

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