Android中全屏无标题设置

方法一:在java代码中实现
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
WindowManager.LayoutParams.FLAG_FULLSCREEN);


方法二:在AndroidManifest.xml中根据需要在<application/>或<activity/>中使用Android系统定义的Android主题方式进行设置
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"


方法三:先在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"

猜你喜欢

转载自danielhan.iteye.com/blog/2119966