wince +sl 群

android activity窗口的大小及移动activity

Activity的窗口大小,其本质还是通过windowManager来操作,WindowManger将其作为一个window来控制大小

          WindowManager m = getWindowManager();
        Display d = m.getDefaultDisplay();
        android.view.WindowManager.LayoutParams p = getWindow().getAttributes();
        p.height = (int)(d.getHeight() *0.8);
        p.width = (int)(d.getWidth()*0.7);
        p.dimAmount = 0.0f;
        getWindow().setAttributes(p);

posted @ 2016-08-18 18:06  pengxinglove  阅读(3333)  评论(0编辑  收藏  举报
wince +sl 群