I am styling an Image component with flexbox to be in the center of the screen which works pretty well. Now I want a second Image component to be d
I needed to find the position of an element inside a ListView and used this snippet that works kind of like .offset:
const UIManager = require('NativeModules').UIManager;
const handle = React.findNodeHandle(this.refs.myElement);
UIManager.measureLayoutRelativeToParent(
handle,
(e) => {console.error(e)},
(x, y, w, h) => {
console.log('offset', x, y, w, h);
});
This assumes I had a ref='myElement' on my component.