2

i want to custom my actionbar using appcompat but i cant change the color of the line below the actionbar, the little thin line below actionbar, i want to make it color yelow instead of the default light blue color below the actionbar

this is my code:

values folder

<!-- MY CUSTOM THEME FOR MY SUPPORT LIBRARY -->
<style name="MyCustomSupportLibraryTheme" parent="@style/Theme.AppCompat.Light">
    <item name="actionBarStyle">@style/MyActionBar</item>
    <item name="actionBarTabTextStyle">@style/TabTextStyle</item>
    <item name="actionBarTabBarStyle">@style/TabBarStyle</item>
    <item name="actionMenuTextColor">@color/actionbar_text_white</item>
</style>

<!-- GENERAL STYLES FOR THE ACTION BAR  --> 
<style name="MyActionBar" parent="@style/Widget.AppCompat.ActionBar">
    <item name="titleTextStyle">@style/TitleTextStyle</item>
    <item name="background">@color/actionbar_background_window_black</item>
    <item name="backgroundStacked">@color/actionbar_background_actionbar_black</item>
    <item name="backgroundSplit">@color/actionbar_background_split_yellow</item>
</style>

<!-- THIN BAR THAT APPEARS BELOW THE NAVIGATION TABS -->
<style name="TabBarStyle" parent="Widget.AppCompat.ActionBar.TabBar">
    <item name="background">@color/red</item>
</style>

<!-- ACTION BAR TITLE TEXT -->
<style name="TitleTextStyle"
       parent="@style/TextAppearance.AppCompat.Widget.ActionBar.Title">
    <item name="android:textColor">@color/actionbar_text_yellow</item>
</style>

<!-- ACTION BAR TAB TEXT -->
<style name="TabTextStyle"
       parent="@style/Widget.AppCompat.ActionBar.TabText">
    <item name="android:textColor">@color/actionbar_text_yellow</item>
</style>

values-v14

<style name="MyCustomSupportLibraryTheme" parent="@style/Theme.AppCompat.Light">
        <item name="android:actionBarStyle">@style/MyActionBar</item>
        <item name="android:actionBarTabTextStyle">@style/TabTextStyle</item>
        <item name="android:actionBarTabBarStyle">@style/TabBarStyle</item>
        <item name="android:actionMenuTextColor">@color/actionbar_text_white</item>
    </style>

    <!-- general styles for the action bar -->
    <style name="MyActionBar" parent="@style/Widget.AppCompat.ActionBar">
        <item name="android:titleTextStyle">@style/TitleTextStyle</item>
        <item name="android:background">@color/actionbar_background_window_black</item>
        <item name="android:backgroundStacked">@color/actionbar_background_actionbar_black</item>
        <item name="android:backgroundSplit">@color/actionbar_background_split_yellow</item>
    </style>

    <!-- thin bar that appears below the navigation tabs -->
    <style name="TabBarStyle" parent="Widget.AppCompat.ActionBar.TabBar">
        <item name="android:background">@color/red</item>
    </style>

    <!-- action bar title text -->
    <style name="TitleTextStyle" parent="@style/TextAppearance.AppCompat.Widget.ActionBar.Title">
        <item name="android:textColor">@color/actionbar_text_yellow</item>
    </style>

    <!-- action bar tab text -->
    <style name="TabTextStyle" parent="@style/Widget.AppCompat.ActionBar.TabText">
        <item name="android:textColor">@color/actionbar_text_yellow</item>
    </style>
Piolo Opaw
  • 1,471
  • 2
  • 15
  • 21
  • I think, from memory, it's part of the background drawable. You'll have to make a custom one, or use a 'solid' action bar instead of a transparent one. There are some hints in the drawables here: http://jgilfelt.github.io/android-actionbarstylegenerator/ – Tim Malseed Nov 29 '13 at 03:41

0 Answers0