0

I want to get the position of the object without touching the view or the object. I am using enter link description here

to slide the object but i want to get the position of the object without touching the slider. Is there any way to get the position.

Kaushal Lalani
  • 125
  • 2
  • 16
  • Your description is not clear. You attached link to slider package but better would be screenshot with pointed object you want. Anyway to get position you can use measureLayout https://reactnative.dev/docs/direct-manipulation#measurelayoutrelativetonativecomponentref-onsuccess-onfail – CodeJoe Dec 14 '22 at 14:16
  • @CodeJoe Thanks for the suggestion i got the position of the object with the help of the measureLayout props. – Kaushal Lalani Dec 16 '22 at 03:26
  • I'm happy to hear it :) I'll convert it to answer so other users could easily find solution – CodeJoe Dec 17 '22 at 12:22

1 Answers1

1

To get the position of element you can use measureLayout. It's well explained with provided example in documentation:

https://reactnative.dev/docs/direct-manipulation#measurelayoutrelativetonativecomponentref-onsuccess-onfail

CodeJoe
  • 262
  • 2
  • 10