android 设置Dialog的宽度

1     private void setWinWidth() {
2         DisplayMetrics metric = new DisplayMetrics();
3         getWindowManager().getDefaultDisplay().getMetrics(metric);
4         LayoutParams p = getWindow().getAttributes();
5         p.width = (int) (metric.widthPixels * 0.8);
6         getWindow().setAttributes(p);
7     }

 

posted on 2013-06-25 09:58  邹创  阅读(998)  评论(0编辑  收藏  举报

导航