我正在使用自定义CursorAdapter来覆盖newView()和bindView()以显示自定义ListView。使用自定义CursorAdapter使ListView行可点击
我膨胀所述行布局xml文件和一个OnClickListener结合)作为参数传递给bindView(视图:
public void bindView(View view, Context context, Cursor cursor) {
view.setOnClickListener(new OnClickListener() { }
...
}
我还在行XML使用相对布局:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingTop="10px"
android:paddingBottom="10px"
android:paddingLeft="10px"
android:paddingRight="10px"
android:clickable="true"
android:focusable="true"
android:focusableInTouchMode="true"
>
<TextView android:id="@+id/episode_title_text" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:textSize="20px"
android:layout_weight="1"
/>
</RelativeLayout>
我的问题是,当我点击列表中的项目,没有任何反应,OnClickListener.onClick()永远不会被调用。
关于问题可能是什么的任何想法?
谢谢。
干得好,谢谢! – 2014-09-29 05:09:56