Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is location of getLocationOnScreen return for?

Tags:

android

As i understand that when we pass int[2] location array into view.getLocationOnScreen(location), we will get left,top coordinates of that view. But when i debug this function, i see that location return for right,top coordinates of that view. my screen is 480x800, i margin right for view is 40, so the right coordinate of view is 440 , it equal to location[0] return from view.getLocationOnScreen(location). Why location[0] return for right coordinate of view?

like image 934
MichaelP Avatar asked Aug 02 '12 11:08

MichaelP


1 Answers

it is exact return for left,top coordinates of that view. I get wrong value because my view still not rendered before i call view.getLocationOnScreen(location).

like image 55
MichaelP Avatar answered Nov 03 '22 06:11

MichaelP