1

My app interface originally looked like this. "my name" is a TextView and "my button" is a button which has an image as the background. Minimum sdk is 16.

pic 1

I changed the action bar color of the app by adding a custom theme. I used the code below.

<style name="AppTheme" parent="Theme.AppCompat.Light">
    <item name="android:actionBarStyle">@style/MyTheme</item>
    <!-- Customize your theme here. -->
</style>
<style name="MyTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="android:background">@color/com_facebook_blue</item>
</style>

Then my output came like this. enter image description here

All the background color got changed to the new color of the app. I only need to change the color of the action bar. Can anyone help me?

Community
  • 1
  • 1
Lak
  • 381
  • 1
  • 5
  • 23

1 Answers1

0

Try this

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>
Ziem
  • 6,579
  • 8
  • 53
  • 86