简体   繁体   中英

How to change Up button Android ActionBar?

I searched many solutions and implemented solution of Jake Wharton

My style.xml code is

<resources>

    <style name="AppBaseTheme" parent="android:Theme.Light">
        <item name="android:actionBarStyle">@style/MyActionBar</item>
        <item name="android:homeAsUpIndicator">@drawable/aeromyorders</item>
    </style>

    <style name="AppTheme" parent="AppBaseTheme">
        <item name="android:actionBarStyle">@style/MyActionBar</item>
    </style>

    <style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
        <item name="android:background">@drawable/bg_actionbar</item>
        <item name="android:homeAsUpIndicator">@drawable/up_caret</item>
    </style>

</resources>

but still my Actionbar up button is default what i have to do now? i also replaced Vaues-v11 style also.. My Min SDK is 15 Max 19 in Manifest

Try this code in Your Activity. set Your Custom Back Button

getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_actionbar_screen_back);

Hope it helps...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM