本机动作条selectableItemBackground与ActionBarSherlock [英] Native ActionBar selectableItemBackground with ActionBarSherlock

查看:111
本文介绍了本机动作条selectableItemBackground与ActionBarSherlock的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图改变在动作条的选定项的背景。我用ActionBarSherlock能够与旧版本的Andr​​oid版本兼容。我设置一个特定的主题,我的活动,当应用程序运行ICS的设备上。

I try to change the background of an selected item in the ActionBar. I use ActionBarSherlock to be compatible with older Android Versions. I set a specific theme to my Activity when the App runs on a device with ICS.

这是我当前的风格:

<style name="Theme.Custom.Light" parent="@android:style/Theme.Holo.Light.DarkActionBar">
    <item name="android:actionBarItemBackground">@drawable/abs__item_background_holo_dark</item>
    <item name="android:selectableItemBackground">@drawable/abs__item_background_holo_dark</item>
</style>

我的绘制是这样的:

My drawable looks like this:

<selector xmlns:android="http://schemas.android.com/apk/res/android"
      android:exitFadeDuration="@android:integer/config_mediumAnimTime">
    <item android:state_focused="true"  android:state_enabled="false" android:state_pressed="true" android:drawable="@drawable/abs__list_selector_disabled_holo_dark" />
    <item android:state_focused="true"  android:state_enabled="false"                              android:drawable="@drawable/abs__list_selector_disabled_holo_dark" />
    <item android:state_focused="true"                                android:state_pressed="true" android:drawable="@drawable/abs__list_selector_background_transition_holo_dark" />
    <item android:state_focused="false"                               android:state_pressed="true" android:drawable="@drawable/abs__list_selector_background_transition_holo_dark" />
    <item android:state_focused="true"                                                             android:drawable="@drawable/abs__list_focused_holo" />
    <item                                                                                          android:drawable="@android:color/transparent" />
</selector>

有似乎是该属性将不被overrided。做什么我错了?

It seems to be that the attribute would not be overrided. What do I wrong?

推荐答案

我找到了解决方案,通过myselft。我只是忘了巴新的复制到我的绘制,MDPI和绘制-xhdpi文件夹。

I found the solution by myselft. I simply forgot to copy the png's to my drawable-mdpi and drawable-xhdpi folder.

这篇关于本机动作条selectableItemBackground与ActionBarSherlock的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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