其他分享
首页 > 其他分享> > 侧滑菜单(navigationView)

侧滑菜单(navigationView)

作者:互联网

MainActivity.java

//去掉标题栏(activity继承自AppCompatActivity),为了显示ToolBar
supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
//如果activity继承自Activity
requestWindowFeature(Window.FEATURE_NO_TITLE);

Window window = getWindow();
//强制显示状态栏
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
//window负责系统bar的background绘制,绘制透明背景的系统bar
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
//设置状态栏颜色
window.setStatusBarColor(Color.parseColor("#ffffff"));
window.setStatusBarColor(Color.TRANSPARENT);

//设置状态栏字体为黑色
window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
//设置状态栏字体为白色
//window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);

标签:菜单,状态栏,侧滑,TITLE,window,SYSTEM,FLAG,navigationView,Window
来源: https://www.cnblogs.com/orangeooo/p/15636256.html