0

I am using the view.getLocationInWindow(positionVariable) method, but the y position is giving some offset value, maybe because of the notification bar on the top. So I used an offset variable.

But the problem is, when I tested on another device, the notification bar was on the bottom. So my view translation didn't work well.

How to get the exact x,y position of a view independent of where the notification bar is?

Pang
  • 9,564
  • 146
  • 81
  • 122
Aparna
  • 835
  • 2
  • 23
  • 47
  • http://stackoverflow.com/questions/2224844/how-to-get-the-absolute-coordinates-of-a-view – gor Oct 28 '15 at 12:22

1 Answers1

0

Use view methods getTop() and getLeft().

Ircover
  • 2,406
  • 2
  • 22
  • 42