Android 带有EditText和SwipedSmissListViewTouchListener的ListView
我已经创建了一个ListView,它的每一行都有一个EditText。ListView还允许用户从中使用SwipedSmissListViewTouchListener.java水平滑动来删除列表中的项目 这两种功能都很好地工作,除了当用户尝试在EditText上执行初始动作向下事件时。看起来EditText在将动作向下事件传递给SwipedSmissListViewTouchListener之前正在使用动作向下事件,SwipedSmissListViewTouchListener需要动作向下事件来初始化手势 问题: 在EditText上启动滑动手势时,如何使SwipedSmissListViewTouchListener工作 SampleListFragment.java: row.xml: *fragment_sample.xml:*Android 带有EditText和SwipedSmissListViewTouchListener的ListView,android,android-listview,android-edittext,Android,Android Listview,Android Edittext,我已经创建了一个ListView,它的每一行都有一个EditText。ListView还允许用户从中使用SwipedSmissListViewTouchListener.java水平滑动来删除列表中的项目 这两种功能都很好地工作,除了当用户尝试在EditText上执行初始动作向下事件时。看起来EditText在将动作向下事件传递给SwipedSmissListViewTouchListener之前正在使用动作向下事件,SwipedSmissListViewTouchListener需要动作向下事
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@android:id/list"
android:name="com.example.app.SampleListFragment"
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1.0"
android:descendantFocusability="beforeDescendants"
tools:context=".SampleActivity"
tools:layout="@android:layout/list_content"/>
</LinearLayout>
正在尝试将其添加到row.xml中的LinearLayout中:
android:descendantFocusability="blocksDescendants"
编辑:
因此,显然EditText比listview中的按钮更复杂。如果你必须把它们放在你的电脑里,也许这个答案可以帮你找到正确的方向:这似乎不起作用。SwipedSmissListViewTouchListener仍然没有收到ACTION\u DOWN事件。我认为这个答案可能更接近我需要的答案:。我似乎不知道如何在代码中实现从手势检测器到OnTouchListener的转换。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@android:id/list"
android:name="com.example.app.SampleListFragment"
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1.0"
android:descendantFocusability="beforeDescendants"
tools:context=".SampleActivity"
tools:layout="@android:layout/list_content"/>
</LinearLayout>
android:descendantFocusability="blocksDescendants"