Home > Mobile >  How do you know a control Android on the relative position of the screen
How do you know a control Android on the relative position of the screen

Time:12-03

Looking for a lot of didn't see you can get a control method of distance from the edge of the screen up and down or so,

CodePudding user response:

With https://blog.csdn.net/qq_24712507/article/details/53994723

CodePudding user response:


Using these two methods, the above represents the absolute position relative to the parent control, the following is what absolute position relative to the screen, the returned array is there are two Numbers [0] is X; [1] to Y

refer to the original poster Xu Shu fia response:
looking for a lot of didn't see you can get a control method of distance from the edge of the screen up and down or so

CodePudding user response:

getLocationOnScreen
  • Related