利用layoutparams修改view的位置

WindowManager.LayoutParams p = (WindowManager.LayoutParams) view.getLayoutParams();
p.x=dx;
p.y=dy;
WindowManager mWindowManager = (WindowManager)getApplicationContext().getSystemService(Context.WINDOW_SERVICE);
mWindowManager.updateViewLayout(view, p);

 

 

详见popupwindow.update(int int int int)方法

转载于:https://www.cnblogs.com/Nbox1989/p/4326709.html

你可能感兴趣的:(利用layoutparams修改view的位置)