成语列表animal_item.xml
<?xml version="1.0" encoding="utf-8" ?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
<strong>android:descendantFocusability="blocksDescendants"</strong>
>
<TextView
android:id="@+id/tvName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:gravity="center"
android:text="我们爱学习"
android:textAppearance="?android:attr/textAppearanceLarge"/>
<ImageButton
android:focusable="false"
android:id="@+id/btnSave"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:layout_alignTop="@+id/tvName"
<span style="color:#ff0000;"> </span><strong><span style="color:#ff0000;"> </span>android:layout_alignParentRight="true"</strong>
android:src="@drawable/btnsave" />
</RelativeLayout>
正如以上文件中所写的在Listview中添加ImageViewButton时,当你点击列表时ImageButton会优先获取焦点,导致点击列表没有响应,所以只需在xml文件中加入<strong>android:descendantFocusability="blocksDescendants"</strong>
<strong>android:layout_alignParentRight="true"</strong>
即可。。。