我有一个列表,里面有两个按钮。当我想单击一个列表项时,它不起作用,但我的按钮仍然可以单击。 如何使所有按钮都包含整个列表项可点击?
项目清单:
<TwoLineListItem xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:mode="twoLine">
<Button
android:id="@+id/erase"
android:layout_width="40dip"
android:layout_height="40dip"
android:focusable="false"
android:focusableInTouchMode="false"/>
<ImageButton android:id="@+id/soundf"
android:layout_width="40dip"
android:layout_height="40dip"
android:focusable="false"
android:focusableInTouchMode="false"/>
<TextView android:id="@+id/texxt1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="#CC0"/>
</TwoLineListItem>
包含 ListView 的布局:
<LinearLayout android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<Button android:id="@+id/left"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="English to Indonesia"
android:layout_weight="1"
android:background="@drawable/chbutt" />
<Button android:id="@+id/right"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Indonesia to English"
android:layout_weight="1"
android:background="@drawable/chbutt" />
</LinearLayout>
<ListView android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:id="@+id/history"
android:headerDividersEnabled="false"
android:footerDividersEnabled="false"
android:isScrollContainer="false" />
</LinearLayout>