1

[android][android studio][status bar]

I cannot find how to change colors of statusbar in andriod using xml.
[1]This is the photo of example how it must look -->: https://i.stack.imgur.com/n0QM4.png

Anand
  • 857
  • 1
  • 12
  • 18
  • You can change statusbar color within your app however you like, however android only supports black or white icons & text. – Pawel Jul 08 '21 at 23:07

1 Answers1

5

Yes,android only supports black or white icons & text.

We can change the statusBarColor of status bar by property android:statusBarColor in file styles.xml:

 <item name="android:statusBarColor">@color/colorgreen</item>

And when we change the value of property android:windowLightStatusBar to true,the color of icons & text will be grayed out.

<item name="android:windowLightStatusBar">true</item>

When using the following code:

<style name="AppTheme.NoActionBar">
    <!-- other code -->
  <item name="android:statusBarColor">@color/colorgreen</item>
  <item name="android:windowLightStatusBar">true</item>
</style>

The result is:

enter image description here

Jessie Zhang -MSFT
  • 9,830
  • 1
  • 7
  • 19