方法一:在java代码中实现
//取消标题
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
//全屏
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
方法二:在AndroidManifest.xml中根据需要在<application/>或<activity/>中使用Android系统定义的Android主题方式进行设置
方法三:先在res/values下创建一个styles.xml文件,在文件中写入如下内容
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="theme_fullScreen">
<!-- 设置无标题 -->
<item name="android:windowNoTitle">true</item>
<!-- 设置全屏 -->
<item name="android:windowFullscreen">true</item>
</style>
</resources>
然后,在AndroidManifest.xml中根据需要在<application/>或<activity/>中使用自定义的Android主题方式进行设置
android:theme="@style/theme_fullScreen"
//取消标题
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
//全屏
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
方法二:在AndroidManifest.xml中根据需要在<application/>或<activity/>中使用Android系统定义的Android主题方式进行设置
方法三:先在res/values下创建一个styles.xml文件,在文件中写入如下内容
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="theme_fullScreen">
<!-- 设置无标题 -->
<item name="android:windowNoTitle">true</item>
<!-- 设置全屏 -->
<item name="android:windowFullscreen">true</item>
</style>
</resources>
然后,在AndroidManifest.xml中根据需要在<application/>或<activity/>中使用自定义的Android主题方式进行设置
android:theme="@style/theme_fullScreen"