【发布时间】:2011-04-06 10:20:15
【问题描述】:
我有一个 ListActivity 按预期工作。单击列表项时,应用程序会正确响应。我想在屏幕最右侧的每个列表项旁边添加一个复选框。当我试图通过更新 XML(见下文)来做到这一点时,我失去了 onListItemClick 功能。当我点击一个列表项时,什么也没发生。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TableLayout
android:id="@+id/table1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:stretchColumns="1">
<TableRow>
<TextView android:id="@+id/tvProduct"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:paddingLeft="10sp"
android:paddingRight="10sp" />
</TableRow>
</TableLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView android:id="@+id/tvPrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10sp"
android:paddingRight="10sp"
android:textColor="#606060" />
</LinearLayout>
</LinearLayout>
我正在尝试在 tvProduct 对象旁边添加复选框。
感谢任何帮助。
【问题讨论】:
标签: android