0

I know that you can change the status bar color in Android's themes.xml file with the following line:

<item name="android:statusBarColor" tools:targetApi="l">@color/teal_200</item>

That being said, if I want to customize the color (ie. make it a hex value), how can I do this?

Brittany
  • 1,359
  • 4
  • 24
  • 63
  • I hope the information in this link can help you. [How to change the status bar color in Android?](https://stackoverflow.com/questions/22192291/how-to-change-the-status-bar-color-in-android) – Asadbek Turg'unboyev Jul 16 '22 at 19:30

1 Answers1

0

You can define your own custom colors in a colors.xml file in your res/values directory.

In colors.xml you can do something like the following with your preferred hex value:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="custom_color">#FF3A52B2</color>
</resources>

And in your themes.xml file you can then reference that custom color as follows:

<item name="android:statusBarColor" tools:targetApi="l">@color/custom_color</item>