I am using Android Navigation bar
in my project,
I want to change the top color in action bar to something red, How can i do that?
I have something like this,
and i want something like this,
how can i achieve that?
I am using Android Navigation bar
in my project,
I want to change the top color in action bar to something red, How can i do that?
I have something like this,
and i want something like this,
how can i achieve that?
in the style.xml add this code
For Android 3.0 and higher only
When supporting Android 3.0 and higher only, you can define the action bar's background like this:
res/values/themes.xml
For Android 2.1 and higher
When using the Support Library, your style XML file might look like this:
Then apply your theme to your entire app or individual activities:
for more details Documentaion
As I was using
AppCompatActivity
above answers didn't worked for me. But the below solution worked:In res/styles.xml
PS: I've used
colorPrimary
instead ofandroid:colorPrimary
You can change action bar color on this way:
Thats all you need for changing action bar color.
Plus if you want to change the status bar color just add the line:
Here is a screenshot taken from developer android site to make it more clear, and here is a link to read more about customizing the color palete
Use this - http://jgilfelt.github.io/android-actionbarstylegenerator/
Good tool to customize your actionbar with a live preview in couple of minutes.
You can define the color of the ActionBar (and other stuff) by creating a custom Style:
Simply edit the res/values/styles.xml file of your Android project.
For example like this:
Then set "MyCustomTheme" as the Theme of your Activity that contains the ActionBar.
You can also set a color for the ActionBar like this:
Taken from here: How do I change the background color of the ActionBar of an ActionBarActivity using XML?