Home Icon Up Compatibility Indicator Action Bar

I am trying to change the up indicator, I have implemented a new action bar, and I cannot configure it.

I tried adding values-v11 / styles.xml

<style name="MyActionBar" parent="@style/Widget.AppCompat.Light.ActionBar">
    <item name="android:icon">@drawable/ic_action_logo_barra_de_acciones_blanco</item>
    <item name="android:background">@drawable/action_bar_style</item>
    <item name="android:homeAsUpIndicator">@drawable/arrow_up_black</item>
</style>

and values ​​/styles.xml

<style name="MyActionBar" parent="@style/Widget.AppCompat.Light.ActionBar">
    <item name="background">@drawable/action_bar_style</item>
    <item name="icon">@drawable/ic_action_logo_barra_de_acciones_blanco</item>
    <item name="homeAsUpIndicator">@drawable/arrow_up_black</item>
</style>

But still not working.

Thanks in advance, Diego.

+4
source share
1 answer

Sorry, maybe it’s too late, but I had the same problem and it was solved by defining “homeAsUpIndicator” in the main topic before the ActionBar style. Here are my res / values ​​/styles.xml

<style name="AppBaseTheme" parent="@style/Theme.AppCompat.Light">
</style>

<style name="AppTheme"  parent="AppBaseTheme">
    <item name="homeAsUpIndicator">@drawable/abc_ic_ab_back_holo_dark</item>
    <item name="actionBarStyle">@style/Widget.Styled.ActionBar</item>
</style>

<style name="Widget.Styled.ActionBar" parent="@style/Widget.AppCompat.Light.ActionBar">
    <item name="background">@drawable/messages_form_banner</item>
</style>

Hope this helps you.

+4
source

Source: https://habr.com/ru/post/1502861/


All Articles