删除动作条项目蓝色背景 [英] Remove actionbar item blue background

查看:114
本文介绍了删除动作条项目蓝色背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建自定义看,我把在menu.xml文件的图标部分按钮的动作条。

I am creating an actionbar with custom looking buttons that I put in the icon section of menu.xml.

的问题是,当我preSS它们,我看到按钮的图像的两个所选择的版本和的全息主题的蓝色背景

The problem is that, when I press them, I see both the selected version of the image of the button and the blue background of the holo theme.

这是我menu.xml文件:

This is my menu.xml:

<menu xmlns:android="http://schemas.android.com/apk/res/android" >

    <item
        android:id="@+id/current_position"
        android:icon="@drawable/ab_location_layer"
        android:menuCategory="container"
        android:showAsAction="ifRoom"
        android:title="Current position">
    </item>

</menu>

该ab_location_layer是这样的:

The ab_location_layer is this:

<selector xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:drawable="@drawable/ab_location_pressed" android:state_pressed="true"/>
    <item android:drawable="@drawable/ab_location" android:state_pressed="false"/>

</selector>

的ab_location_layer中包含的图像是比动作条小。 如何能够去除蓝色背景上动作条?我也使用actionbarsherlock。

The ab_location_layer contains an image that is smaller than the actionBar. How is possible to remove the blue background on actionbar? I am also using actionbarsherlock.

感谢

推荐答案

我发现ActionBarSherlock通讯录答案:

I found the answer on ActionBarSherlock Mailing List:

你必须把这个

  <item name="android:selectableItemBackground">@null</item>
    <item name="android:actionBarItemBackground">@null</item>
    <item name="actionBarItemBackground">@null</item>

你的主题,而不是在动作条主题

to your theme and not in ActionBar theme

这篇关于删除动作条项目蓝色背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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