How to change statusbar text color to dark on android 4.4

后端 未结 2 1979
野趣味
野趣味 2021-01-11 12:33

Almost 2 weeks ago, I was searching How to change the text color of the statusbar to dark color on android 4.4

The default text color is white, like this

Bec

相关标签:
2条回答
  • 2021-01-11 13:04

    It's not possible to change the color of the status bar in android. The only thing you can set in your app is the status bar's background color (see this thread).

    Maybe you can post some more information about your problem (your links don't work).

    0 讨论(0)
  • 2021-01-11 13:18

    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

    <style name="statusBarStyle" parent="@android:style/Theme.DeviceDefault.Light">
        <item name="android:statusBarColor">@color/status_bar_color</item>
        <item name="android:windowLightStatusBar">false</item>
    </style>
    

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

    0 讨论(0)
提交回复
热议问题