how to custom the thin line below actionbar using AppCompat in android?

和自甴很熟 提交于 2019-12-12 20:12:09

问题


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>

来源:https://stackoverflow.com/questions/20277867/how-to-custom-the-thin-line-below-actionbar-using-appcompat-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!