0

작업 표시 줄에서 실행 가능한 항목의 적중 상태 색을 변경하려고합니다. 내 넥서스 7 (4.3)에서 히트 상태의 기본 색상은 청록색입니다. 내 넥서스 4 (4.4)에서 적중 상태는 holo_light입니다. 'android : selectableItemBackground'를 holo_light로 설정 한 후에도 내 넥서스 7의 버튼 누름에 청록색 파란색이 표시됩니다.SelectableItemBackground가 작업 표시 줄 스타일과 작동하지 않습니다.

여기에 제가 사용하고있는 코드가 있습니다.

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

누군가가 내가 여기에 놓친 거지 무엇을 지적 할 수 있습니까?

답변

0

마지막으로이 문제가 해결되었습니다. 다른 스타일 "android : listViewStyle"을 추가해야했습니다.

관련 문제