Skip to content

Instantly share code, notes, and snippets.

Created April 15, 2015 14:35
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Get react-native view dimensions
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
Copy link

gre commented Aug 5, 2015

you can (now?) directly do:

this.refs.view.measure((frameX, frameY, frameWidth, frameHeight, pageX, pageY) => {


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment