我有一个 FrameLayout,我想通过选择器为其应用前景可绘制对象,我正在尝试实现“drawSelectorOnTop”,但对于一个简单的布局
现在当用户按下“state_pressed”时选择器不适用
这是我的代码:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:foreground="@drawable/cell_background_selector" >
    <RelativeLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#282828"
        android:paddingBottom="5dp" >
..
......
........
</RelativeLayout>
</FrameLayout>
这是我的选择器代码:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/video_blank" android:state_pressed="true"/>
     <item android:drawable="@drawable/fav_show"/>
</selector>
两个图像都存在,但 FrameLayout 始终将正常状态可绘制应用为前景