全屏Activity的实现(去除标题栏、去除系统状态栏)
作者:互联网
- 去除安卓系统顶部状态栏:
requestWindowFeature一定要在setContentView之前调用:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_main);
}
- 去除app标题栏
在activity的样式里加入:
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
标签:标题栏,状态栏,setContentView,去除,WindowManager,Activity,onCreate 来源: https://blog.csdn.net/LAMP_zy/article/details/49333609