سؤال

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.

This is my current style:

<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>

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

لا يوجد حل صحيح

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top