expo / ex-navigator

Route-centric navigation built on top of React Native's Navigator
MIT License
522 stars 68 forks source link

problems with UIManager.measure() #117

Closed jurgenphotek closed 8 years ago

jurgenphotek commented 8 years ago

Hi, In addition to ex-navigator I am using another component from another library that positions itself based on the results of the measure fn, as described here: https://facebook.github.io/react-native/docs/nativemethodsmixin.html

unfortunately for the same navigator views that fn returns different results depending on whether it is the initial route or whether it was pushed (pageX prop returned from measure() is 0 or the same as screen width ). not sure if there is a better method to use for dimensions or some other trick to using ex-navigator to get consistent results?

thanks

ide commented 8 years ago

I would expect the dimensions to be measured the same everywhere but the absolute position of the component of course will differ if it's sliding in from the right.

jurgenphotek commented 8 years ago

hm, ok. so it somehow it needs to get dimensions post-slide

ide commented 8 years ago

Generally speaking, relying on pageX isn't what you want. Better to find the local X coordinate instead of the absolute one for robustness.

jurgenphotek commented 8 years ago

ok thanks