I have two text views in a scrollView and I want to get their Y position when I tap them.
But I have tried many things in the debug console, always returning 0:
subView.getY()
subView.getScrollY()
What to do instead?
Thanks for your help.
I have two text views in a scrollView and I want to get their Y position when I tap them.
But I have tried many things in the debug console, always returning 0:
subView.getY()
subView.getScrollY()
What to do instead?
Thanks for your help.
Use getLocationOnScreen()
method of view and pass int array and get 0 and 1 position for X and Y.