Using measure() with a relative-to component / stable "pageY" when inside a ScrollView?
#8691
-
|
I'm trying to obtain the y-position of the elements inside a ScrollView, but if you nest views the measure() would always return a Unfortunately right now I have to keep passing on the parent's "pageY" just so the children's pageY are correct and stable Is there any other way of doing this? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hey @marqroldan! Unfortunately, there is no other way than this. You have to figure out yourself how to best get the relative position of the view. If you want to get the position of the view relative to the ScrollView outer view, then you can call |
Beta Was this translation helpful? Give feedback.
Hey @marqroldan!
Unfortunately, there is no other way than this. You have to figure out yourself how to best get the relative position of the view. If you want to get the position of the view relative to the ScrollView outer view, then you can call
measurefor the ScrollView's ref and calculate the difference.