两种方式: 第一种:

直接在AndroidManifest.xml文件中设定Activity主题为全屏模式
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

第二种:

requestWindowFeature(Window.FEATURE_NO_TITLE);

getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);

注意的是通过这种方法实现的时候需要将以上两方法执行在setContentView之前才有效。

 

相关文章:

  • 2021-07-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-29
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-11
  • 2022-12-23
  • 2022-12-23
  • 2021-09-21
  • 2021-11-23
相关资源
相似解决方案