具体做法和dialog窗口的设置类似,只需要在onCreate方法中,加入下列代码,既可以控制大小!

  // 设置窗体大小  ScreenUtil.getScreenWidth(LoadActivity.this)为获取屏幕宽度的自定义方法
     LayoutParams params = getWindow().getAttributes();
     params.height = LayoutParams.WRAP_CONTENT;
     params.width = (int) (ScreenUtil.getScreenWidth(LoadActivity.this) * 0.85);
     getWindow().setAttributes(params);

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-17
  • 2022-12-23
  • 2021-06-25
  • 2021-11-04
  • 2021-11-02
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-08
  • 2021-05-28
  • 2021-09-11
相关资源
相似解决方案