1
我有一個UI部分看起來是這樣的:迎頭趕上佈局OnClick事件上它具有要素
<LinearLayout
android:orientation="horizontal"
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/linearLayout4">
<ImageView
android:src="@android:drawable/ic_menu_gallery"
android:layout_width="0dp"
android:layout_height="24dp"
android:layout_weight="1" />
<TextView
android:text="Text"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center" />
</LinearLayout>
我徘徊的可能是否要聽上的LinearLayout click事件,並得到它,即使我點擊ImageView,類似於WPF中發生的路由事件。
謝謝。
[ onLayoutListener on LinearLayout](http://stackoverflow.com/ques tions/2130875/onclicklistener-on-a-linearlayout)和[LinearLayout的click監聽器永遠不會被調用](http://stackoverflow.com/questions/5651894/linearlayouts-click-listener-is-never-called)可能會有所幫助。 –