Question

I want to change the colour of the title bar and the text within it to hex values. What is the quickest and easier way to achieve this? Can this be achieved using the manifest xml file?

Was it helpful?

Solution

You can find how to customize your action bar here

As for setting the values to simply be a hex, the best method to do that is to declare a colors.xml file since any colors you set to the action bar will likely be used elsewhere as well. Declaring it in xml allows for efficient reuse of the same values.

** Edit ** Here's a simple color file. It would be saved in res/values/colors.xml

 <?xml version="1.0" encoding="utf-8"?>
 <resources xmlns:android="http://schemas.android.com/apk/res/android">

<color name="black_overlay">#66000000</color>
<color name="default_screen_bg">#20324a</color>
<color name="rounded_container_bg">#80000000</color>
<color name="rounded_container_border">#3b3f44</color>
<color name="light_gray_header_color">#646663</color>

</resources>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top