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);


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM