有时候在listView弹出对话框的时候,后面的item的onclick可以响应,我想在弹出对话框的时候不响应
public class CustomListView extends ListView {
Context mContext;
public CustomListView (Context context, AttributeSet attrs){
super(context, attrs);
mContext = context;
}
public boolean onTouchEvent(MotionEvent event){
if (event.getRawY() < 100){
Log.d("Your tag", "Allowing the touch to go to the list.");
super.onTouchEvent(event);
return true;
} else {
Log.d("Your tag", "Not allowing the touch to go to the list.");
return true;
}
}
}
<com.steve.CustomListView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/start_menu_background"
android:cacheColorHint="#00000000"
android:id="@android:id/list">
</com.steve.CustomListView>