The colors of status bar on android
默认情况下,状态栏背景色由主题中的 colorPrimaryDark
决定。
设置 setDecorFitsSystemWindows(false)
后,系统不会在 decorView
中绘制状态栏的底色,即 colorPrimaryDark
不会生效。此时任选以下其一(自上至下)既可:
window.setBackgroundDrawableResource
或主题中windowBackgroundColor
window.decorView.backgroundResource
window.decorView
的子视图自顶向下window.statusBarColor
前景色:
<item name="android:windowLightStatusBar">true</item>