利用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)方法

posted @ 2015-03-10 18:15  Nbox1989  阅读(821)  评论(0编辑  收藏  举报