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,073
  • 146
  • 84
  • 117
Aparna
  • 825
  • 2
  • 21
  • 39
  • 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,376
  • 1
  • 20
  • 41