使用的是如下代码:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
View decorView = getWindow().getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
decorView.setSystemUiVisibility(uiOptions);
getWindow().setStatusBarColor(Color.TRANSPARENT);
}
请问如何删除里面状态栏里面的文字与与图标
不太可能,这些图标是系统的东西。你去搜搜有没有系统状态栏隐藏的方法。
代码中设置:在setContentView 之前调用
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
//5.0及以上
WindowManager.LayoutParams localLayoutParams = aty.getWindow().getAttributes();
localLayoutParams.flags = WindowManager.LayoutParams.FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
AndroidManifest里面Activity的Theme使用:
Theme.AppCompat.NoActionBar