カスタム レイアウトで独自のリスト ビュー アイテムを定義したリストがあります。このレイアウトには、カスタム ドローアブルを含む背景があります。
ListView アイテムのカスタム レイアウト:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/item"
android:clickable="true"
android:focusable="true"
android:focusableInTouchMode="true" >
...
</RelativeLayout>
私のカスタムドローアブルitem.xml
:
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- background: shadow -->
<item>
<shape
android:dither="true"
android:shape="rectangle" >
<corners android:radius="2dp" />
<solid android:color="@color/itemShadowColor" />
</shape>
</item>
<!-- foreground: surface -->
<item android:bottom="2dp">
<shape
android:dither="true"
android:shape="rectangle" >
<corners android:radius="2dp" />
<solid android:color="@color/itemBackgroundColor" />
</shape>
</item>
</layer-list>
現在、このアイテムはクリックできなくなりました。
その理由と、ボタン クリックのような同じ動作 (青い背景のセレクター) を行うにはどうすればよいか説明してもらえますか?