我想在我的列表视图的每一行中添加一个按钮。我创建了一个名为
row.xml
的XML文件放在我的布局文件夹中,并在该文件中添加了两个文本框和一个按钮。但是添加按钮后,我无法单击列表视图项,只能单击按钮。以下是row.xml
的内容:<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:id="@+id/text11"
android:layout_alignParentLeft="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="25sp"
android:textColor="#000000"
/>
<TextView
android:id="@+id/text2"
android:layout_alignParentLeft="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="10sp"
android:textColor="#000000"
/>
<Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
</LinearLayout>
我希望在我的活动中引用文本视图和按钮。请帮助我并提供一些想法。