如何在一个活动中隐藏android中的状态栏
问题描述:
我想在正在使用的初始屏幕中隐藏状态栏/通知栏
样式:<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
这不会隐藏状态栏,我该怎么办?
I want to hide status bar / notification bar in splash screen I am using
style:<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
this dose not hide the status bar, how should i do this?
答
如果要删除状态栏,请在onCreateView方法中的setContentView(layout)之前使用它
If you want to remove status bar then use this before setContentView(layout) in onCreateView method
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);