内事不决问百度,下面是baidu到的原帖地址

http://home.searchfull.net:8080/2462345-android+%E8%87%AA%E5%AE%9A+%E5%AF%B9%E8%AF%9D+.html

onCreate()中设置:

WindowManager wm = getWindowManager(); Display display = wm.getDefaultDisplay(); LayoutParams lp = getWindow().getAttributes(); lp.height = display.getHeight() / 2; lp.width = display.getWidth() / 2; getWindow().setAttributes(lp);

效果:

Android: 自定义窗口大小

优化了一下后,可以作为一个frame:

Android: 自定义窗口大小

相关文章:

  • 2021-05-04
  • 2021-06-09
  • 2021-07-21
  • 2021-10-11
  • 2021-05-20
  • 2021-09-24
  • 2022-01-08
  • 2021-09-27
猜你喜欢
  • 2021-11-22
  • 2021-07-12
  • 2021-12-22
  • 2021-10-20
  • 2022-02-02
  • 2021-05-18
相关资源
相似解决方案