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

相关文章:

  • 2021-07-15
  • 2021-08-16
  • 2021-06-20
  • 2022-01-15
  • 2021-07-23
  • 2021-06-12
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-15
  • 2021-12-07
相关资源
相似解决方案