Android Lollipop Set Status Bar Text Color

后端 未结 7 1137
遇见更好的自我
遇见更好的自我 2020-12-14 06:30

I\'m trying to set the status bar text color in Android v21, but I\'m not seeing an API method for it. Here\'s what I have so far for the background

MyActivity.java

7条回答
  •  北海茫月
    2020-12-14 07:10

    You can not set the status bar text color by specifying any color explicitly

    But you can try below alternative which is Added in API 23,

    You can use "android:windowLightStatusBar" attribute in two ways

    • "android:windowLightStatusBar" = true, status bar text color will be compatible (grey) when status bar color is light
    • "android:windowLightStatusBar" = false, status bar text color will be compatible (white) when status bar color is dark
    
    

    You can check above api in below link - https://developer.android.com/reference/android/R.attr.html#windowLightStatusBar

提交回复
热议问题