我使用 Sherlock 操作栏
1,我想在按下时将主页按钮 BG 从蓝色更改为红色
2,我想更改 HomeAsUp 图标(白色箭头)有什么想法吗?
主页按钮
按下
这里创建了这个actionbar代码
extends SherlockFragmentActivity
public ActionBar actionBar;
this.actionBar = this.getSupportActionBar();
this.actionBar.setDisplayShowHomeEnabled(true);
this.actionBar.setHomeButtonEnabled(true);
this.actionBar.setDisplayHomeAsUpEnabled(true);
最佳答案
您可以通过在主题中指定自己的 actionBarItemBackground
属性来更改此设置。
例如,
<style name="Theme.MyTheme" parent="Theme.Sherlock">
<item name="android:actionBarItemBackground">@drawable/my_cool_drawable</item>
<item name="actionBarItemBackground">@drawable/my_cool_drawable</item>
</style>
然后在您的 Activity 的 list 中指定 Theme.MyTheme
。
关于android - 按下时如何更改主页按钮突出显示颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11202138/