{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/4753","labels_url":"https://api.github.com/repos/facebook/react-native/issues/4753/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/4753/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/4753/events","html_url":"https://github.com/facebook/react-native/issues/4753","id":121911734,"number":4753,"title":"[Android] measure always returns 0 for x and y","user":{"login":"theoriginalgri","id":6161006,"avatar_url":"https://avatars.githubusercontent.com/u/6161006?v=3","gravatar_id":"","url":"https://api.github.com/users/theoriginalgri","html_url":"https://github.com/theoriginalgri","followers_url":"https://api.github.com/users/theoriginalgri/followers","following_url":"https://api.github.com/users/theoriginalgri/following{/other_user}","gists_url":"https://api.github.com/users/theoriginalgri/gists{/gist_id}","starred_url":"https://api.github.com/users/theoriginalgri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theoriginalgri/subscriptions","organizations_url":"https://api.github.com/users/theoriginalgri/orgs","repos_url":"https://api.github.com/users/theoriginalgri/repos","events_url":"https://api.github.com/users/theoriginalgri/events{/privacy}","received_events_url":"https://api.github.com/users/theoriginalgri/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/react-native/labels/Android","name":"Android","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-13T10:24:53Z","updated_at":"2015-12-21T12:52:28Z","closed_at":null,"body":"I wrote a small example here: https://gist.github.com/theoriginalgri/e0b2c50a6232ed4ff3c6\r\n\r\nThere are three colored areas, each has the views height. The green one in the middle is clickable and logs its measure() results to the console. Also the green one has a Text element with marginTop=100, which means it should always return y=100. Unfortunately all x and y values are always 0 on android. On iOS all values are returned correctly.\r\n\r\nLog output:\r\n```\r\nAndroid:\r\n12-13 11:23:04.140 7621-30742/com.scrollviewtest I/ReactNativeJS: android green measure: y=0, height=592, pageY=321.5\r\n12-13 11:23:04.140 7621-30742/com.scrollviewtest I/ReactNativeJS: android text measure: x=0, y=0, height=19, pageY=421.5\r\n```\r\n\r\n```\r\niOS:\r\n2015-12-13 11:23:55.987 [trace][tid:com.facebook.React.JavaScript] ios green measure: y=667, height=667, pageY=378.5\r\n2015-12-13 11:23:55.987 [trace][tid:com.facebook.React.JavaScript] ios text measure: x=148.5, y=100, height=17, pageY=478.5\r\n```\r\n\r\nEdit:\r\nMeanwhile I found that measureLayout() does the calculation correctly when supplying the actual parent as first parameter. This does not seem intuitive since one could guess that measure() should always use the direct parent of the view for determining x and y."},"comment":{"url":"https://api.github.com/repos/facebook/react-native/issues/comments/166297479","html_url":"https://github.com/facebook/react-native/issues/4753#issuecomment-166297479","issue_url":"https://api.github.com/repos/facebook/react-native/issues/4753","id":166297479,"user":{"login":"ashleydw","id":844437,"avatar_url":"https://avatars.githubusercontent.com/u/844437?v=3","gravatar_id":"","url":"https://api.github.com/users/ashleydw","html_url":"https://github.com/ashleydw","followers_url":"https://api.github.com/users/ashleydw/followers","following_url":"https://api.github.com/users/ashleydw/following{/other_user}","gists_url":"https://api.github.com/users/ashleydw/gists{/gist_id}","starred_url":"https://api.github.com/users/ashleydw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashleydw/subscriptions","organizations_url":"https://api.github.com/users/ashleydw/orgs","repos_url":"https://api.github.com/users/ashleydw/repos","events_url":"https://api.github.com/users/ashleydw/events{/privacy}","received_events_url":"https://api.github.com/users/ashleydw/received_events","type":"User","site_admin":false},"created_at":"2015-12-21T12:52:28Z","updated_at":"2015-12-21T12:52:28Z","body":"I'm getting this too, will try with the `measureLayout` function. Perhaps you could provide an example of that @theoriginalgri .\r\n\r\nNote: @theoriginalgri Is talking about `ox` and `oy` from the docs."}}