安卓去掉顶部状态栏

时间:2021-10-01 22:35:13

1.手动添加需要在每个activity里面添加://取消顶部标题requestWindowFeature(Window.FEATURE_NO_TITLE);


2.在Android的Manifest.xml(清单文件)里面配置:

<application>        

                     android:theme="@android:style/Theme.NoTitleBar.Fullscreen"  去掉顶部title和状态栏android:label="@string/app_name"     android:icon="@drawable/icon" 

</application>  


3.设置全屏

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