0
我試圖改變動作欄上的可操作的項目的命中狀態色工作。在我的nexus 7(4.3)上,擊中狀態的默認顏色是藍綠色。在我的聯繫4(4.4)中,命中狀態是holo_light。即使設置後,「機器人:selectableItemBackground」到holo_light我看到按鈕按下碧藍我的Nexus 7SelectableItemBackground不動作條的風格
這裏是我使用的代碼。
<style name="CustomActionBarStyle" parent="@android:style/Widget.Holo.Light.ActionBar.Solid">
<item name="android:background">@drawable/bg_image_actionbar</item>
<item name="android:backgroundStacked">@drawable/bg_image_actionbar_stacked</item>
<item name="android:displayOptions">showHome|homeAsUp</item>
<item name="android:icon">@drawable/layer_actionbar_logo</item>
<item name="android:titleTextStyle">@style/ActionBarTitleTextStyle</item>
<item name="android:selectableItemBackground">@drawable/selector_custom_action_bar_selectable_item_bg</item>
</style>
自定義選擇的XML是
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Even though these two point to the same resource, have two states so the drawable will invalidate itself when coming out of pressed state. -->
<item android:state_focused="true" android:state_enabled="false" android:state_pressed="true" android:drawable="@drawable/list_selector_disabled_holo_light" />
<item android:state_focused="true" android:state_enabled="false" android:drawable="@drawable/list_selector_disabled_holo_light" />
<item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/list_selector_background_transition_holo_light" />
<item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/list_selector_background_transition_holo_light" />
<item android:state_focused="true" android:drawable="@drawable/list_pressed_holo_light" />
<item android:drawable="@android:color/transparent" />
</selector>
有人能指出我錯過什麼嗎?