Android全屏设置

时间:2025-01-27 07:56:48

1.代码方式(在setContentView调用之前):

requestWindowFeature(Window.FEATURE_NO_TITLE);// 隐藏标题

getWindow().setFlags(.FLAG_FULLSCREEN,

.FLAG_FULLSCREEN);// 设置全屏

配置:

<application

        ...

        android:theme="@style/"

        ... >

在中添加如下代码:

<style name="AppTheme" parent="AppBaseTheme">
    <item name="android:windowNoTitle">true</item>    <!--无标题-->
    <item name="android:windowFullscreen">true</item>   <!--全屏-->
    <item name="android:windowIsTranslucent">true</item>
</style>