我有一个膨胀的线性布局,其中包含2个TextViews。点击TextView里面膨胀的线性布局
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:orientation="vertical" >
<TextView
android:id="@+id/tv_m"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ll_borders"
android:tag="m"
android:text="m" />
<TextView
android:id="@+id/tv_q"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ll_borders"
android:tag="q"
android:text="q" />
</LinearLayout>
所有我想要的是,当这个线性布局膨胀的话,我想在我点击的唯一TEXTVIEW
。例如,如果我点击“tv_m
”,那么它只会返回tv_m
的文本。
可能它很简单,但我没有办法。所以我需要帮助。
谢谢
好的谢谢..让我试试这个 – Noman 2013-03-22 06:16:18
我犯了一个错误...我也设置了onClick监听器到充气的视图,因为它没有得到它的textView的点击。 反正我现在已经完成了......谢谢:) – Noman 2013-03-22 06:30:39