如何自定义动作条上后退按钮 [英] How to customize the back button on ActionBar

查看:143
本文介绍了如何自定义动作条上后退按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经能够自定义操作栏的背景,标志图像,并使用从这些建议中的文字颜色:

I have been able to customize the action bar's background, logo image and text color using suggestions from these :

<一个href="http://stackoverflow.com/questions/6351479/android-how-to-change-the-actionbar-home-icon-to-be-something-other-than-the">Android:如何改变动作条&QUOT;家&QUOT;图标为比应用程序图标以外的其他?中

动作条的文字颜色

动作条的背景图片

我想自定义的最后一块是后退按钮图像。这是灰色默认情况下,我想它是白色的。要么改变颜色,指定绘制或者干脆使其透明(并加入了雪佛龙到我的自定义徽标图像)会工作。我怎么去的?提前致谢!

The last piece I want to customize is the backbutton image. It's grey by default and I would like it to be white. Either changing the color, specifying a drawable or simply making it transparent (and adding the chevron to my customized logo image) would work. How do I go about that? Thanks in advance!

推荐答案

向上的启示指标是由主题的 homeAsUpIndicator 属性指定的绘制提供。要使用自己的自定义的版本覆盖它会是这样的:

The "up" affordance indicator is provided by a drawable specified in the homeAsUpIndicator attribute of the theme. To override it with your own custom version it would be something like this:

<style name="Theme.MyFancyTheme" parent="android:Theme.Holo">
    <item name="android:homeAsUpIndicator">@drawable/my_fancy_up_indicator</item>
</style>

如果您是支持pre-3.0与您的应用程序可以肯定你把这个版本的自定义主题的值-V11 或类似的。

If you are supporting pre-3.0 with your application be sure you put this version of the custom theme in values-v11 or similar.

这篇关于如何自定义动作条上后退按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆