您的位置:首页 > 其它

自定义Dialog设置显示位置

2012-01-11 14:46 302 查看
Dialog dialog=new Dialog(TestActivity.this);
dialog.setContentView(R.layout.dialog);
Window mWindow = dialog.getWindow();
WindowManager.LayoutParams lp = mWindow.getAttributes();
//缺省居中lp.x=0,lp.y=0 新坐标 x小于0左移,大于0右移;y小于0上移,大于0下移
lp.x= 0;
lp.y= 0;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: