Created
April 15, 2015 14:35
-
-
Save johanneslumpe/e48acd0a820bb322790b to your computer and use it in GitHub Desktop.
Get react-native view dimensions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var UIManager = require('NativeModules').UIManager; | |
// in your component, use whatever ref you have defined on the | |
// view you want to measure | |
UIManager.measure(this.refs.view.getNodeHandle(), (frameX, frameX, frameWidth, frameHeight, pageX, pageY) => { | |
// do something with the measured values | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you can (now?) directly do: