我想自定义up button
,我正在使用appcompat library
我的操作栏。我不想要android提供的默认向上按钮。因为我使用actionbar
的是style generator 产生的。所以这个向上按钮看起来很苍白actionbar
,我选择的颜色。有人可以建议我如何实现吗?我搜索了很多,但找不到。
我已经为它准备了我自己的形象。所以我想用我的图像替换它。我相信这是可能的。因为 googleplay 在应用程序部分以不同颜色显示带有向上按钮的操作栏。
下面是styles.xml:
<style name="Theme.Customab" parent="@style/Theme.AppCompat.Light.DarkActionBar">
<item name="actionBarItemBackground">@drawable/selectable_background_customab</item>
<item name="popupMenuStyle">@style/PopupMenu.Customab</item>
<item name="dropDownListViewStyle">@style/DropDownListView.Customab</item>
<item name="actionBarTabStyle">@style/ActionBarTabStyle.Customab</item>
<item name="actionDropDownStyle">@style/DropDownNav.Customab</item>
<item name="actionBarStyle">@style/ActionBar.Solid.Customab</item>
<item name="actionModeBackground">@drawable/cab_background_top_customab</item>
<item name="actionModeSplitBackground">@drawable/cab_background_bottom_customab</item>
<item name="actionModeCloseButtonStyle">@style/ActionButton.CloseMode.Customab</item>
<!-- Light.DarkActionBar specific -->
<item name="actionBarWidgetTheme">@style/Theme.Customab.Widget</item>
**<item name="android:homeAsUpIndicator">@drawable/customup</item>**
</style>
<style name="ActionBar.Solid.Customab" parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
<item name="background">@drawable/ab_solid_customab</item>
<item name="backgroundStacked">@drawable/ab_stacked_solid_customab</item>
<item name="backgroundSplit">@drawable/ab_bottom_solid_customab</item>
<item name="progressBarStyle">@style/ProgressBar.Customab</item>
</style>
<style name="ActionBar.Transparent.Customab" parent="@style/Widget.AppCompat.ActionBar">
<item name="background">@drawable/ab_transparent_customab</item>
<item name="progressBarStyle">@style/ProgressBar.Customab</item>
</style>
<style name="PopupMenu.Customab" parent="@style/Widget.AppCompat.PopupMenu">
<item name="android:popupBackground">@drawable/menu_dropdown_panel_customab</item>
</style>
<style name="DropDownListView.Customab" parent="@style/Widget.AppCompat.ListView.DropDown">
<item name="android:listSelector">@drawable/selectable_background_customab</item>
</style>
<style name="ActionBarTabStyle.Customab" parent="@style/Widget.AppCompat.ActionBar.TabView">
<item name="android:background">@drawable/tab_indicator_ab_customab</item>
</style>
<style name="DropDownNav.Customab" parent="@style/Widget.AppCompat.Spinner.DropDown.ActionBar">
<item name="android:background">@drawable/spinner_background_ab_customab</item>
<item name="android:popupBackground">@drawable/menu_dropdown_panel_customab</item>
<item name="android:dropDownSelector">@drawable/selectable_background_customab</item>
</style>
<style name="ProgressBar.Customab" parent="@style/Widget.AppCompat.ProgressBar.Horizontal">
<item name="android:progressDrawable">@drawable/progress_horizontal_customab</item>
</style>
<style name="ActionButton.CloseMode.Customab" parent="@style/Widget.AppCompat.ActionButton.CloseMode">
<item name="android:background">@drawable/btn_cab_done_customab</item>
</style>
<!-- this style is only referenced in a Light.DarkActionBar based theme -->
<style name="Theme.Customab.Widget" parent="@style/Theme.AppCompat">
<item name="popupMenuStyle">@style/PopupMenu.Customab</item>
<item name="dropDownListViewStyle">@style/DropDownListView.Customab</item>
</style>