要更改NavigationView的状态栏颜色,需要进行以下步骤:
#FF0000
app:theme="@style/AppTheme.NavigationView"
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(ContextCompat.getColor(this, R.color.navigation_view_status_bar_color));
}
这些步骤将更改NavigationView的状态栏颜色为指定的颜色。请确保将颜色值替换为您想要的实际颜色。