Button view = (Button) findViewById(R.id.button1);
int[] location = new int[2];
view.getLocationOnScreen(location);
Log.i("MainActivity", "x: " + location[0] + " y:" + location[1]);
获取控件屏幕位置
最新推荐文章于 2022-12-12 18:56:59 发布
Button view = (Button) findViewById(R.id.button1);
int[] location = new int[2];
view.getLocationOnScreen(location);
Log.i("MainActivity", "x: " + location[0] + " y:" + location[1]);