我有一個膨脹的線性佈局,其中包含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