<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp" >
<ImageView
android:id="@+id/btn_star"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:contentDescription="@string/description_star"
android:src="@android:drawable/btn_star" />
<TextView
android:id="@+id/text_name"
android:inputType="textMultiLine"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_toLeftOf="@id/btn_share" />
</RelativeLayout>
上記のXML中に問題になったのはTextViewのandroid:inputType="textMultiLine" 。これでClickする時に、FocusをTextViewに奪われる、Item全体のClickEventが無効になってしまう。Touch Eventが全部旨くdispatchされましたが、どうやらlistenerが呼ばれなかった。
没有评论:
发表评论