5.0的标题栏颜色只能通过在style中设定吗?能不能代码动态设置?除了StatusBarTintManager
认证高级PHP讲师
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION); window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); window.setStatusBarColor(Color.TRANSPARENT); //这里动态修改颜色 }
See if it helps here How to dynamically theme Android (using RxBus mode)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
See if it helps here How to dynamically theme Android (using RxBus mode)