Change status bar text color when primaryDark is white

前端 未结 8 1273
自闭症患者
自闭症患者 2021-01-30 06:17

I am trying to reproduce the behaviour of Google Calendar application:

but I have not found a way to change the status text color. If i set the colorPrimaryDark as whit

8条回答
  •  礼貌的吻别
    2021-01-30 06:59

    I'm not sure what API level your trying to target, but if you can use API 23 specific stuff, you can add the following to your AppTheme styles.xml:

    @color/colorPrimaryDark
    true
    

    when android:windowLightStatusBar is set to true, status bar text color will be able to be seen when the status bar color is white, and vice-versa when android:windowLightStatusBar is set to false, status bar text color will be designed to be seen when the status bar color is dark.

    Example:

    
    
    

提交回复
热议问题