我有一个 RelativeLayout
和一些 TextView
作为子项
<RelativeLayout
android:id="@+id/shift_parent_name"
android:layout_width="fill_parent"
android:layout_weight="0.25"
>
<TextView
android:id="@+id/shift_parent_nametitle"
android:text="@string/shift_parent_nametitle"
style="@style/header_text"
/>
<TextView
android:id="@+id/shift_parent_namefield"
android:layout_alignParentRight="true"
android:layout_below="@id/shift_parent_nametitle"
style="@style/wrap"
/>
如果该区域的任何部分被按下,我如何使用 RelativeLayout
作为 按钮 来响应 click 事件?
最佳答案
只需添加 OnClickListener到你的相对布局
关于android - 在 RelativeLayout 中接受点击事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2949211/