I'm creating a grid of Views. I'm doing it using pure flex. i.e. no absolute positioning. 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.
Ok.. I was suspecting that so I ended up saving the row's Y position and then assigning it to the "cells". Thanks for your help @HaitaoLi
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With