Finding the View location (position) on display (screen) in android

后端 未结 5 454
滥情空心
滥情空心 2020-12-19 04:50

I want to find the view\'s position on the display screen.

To do it, I use the methods such as view.getLeft() ,view.getBottom() , vi

5条回答
  •  天命终不由人
    2020-12-19 05:00

    Easiest way is to get it using View.getLocationOnScreen(); OR getLocationInWindow();

    And if you want position relative to root Layout then See

提交回复
热议问题