Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

滑动判断有问题 #1

Open
gybin02 opened this issue Feb 11, 2019 · 1 comment
Open

滑动判断有问题 #1

gybin02 opened this issue Feb 11, 2019 · 1 comment

Comments

@gybin02
Copy link

gybin02 commented Feb 11, 2019

当只有一个删除按钮的时候,滑动列表,手一放开,就自动还原了,点击不了删除

== 意思是包含内容,同时只有一个侧滑删除的按钮。

@mrme2014
Copy link
Owner

大致懂你的意思

item布局里面要这么写额,要有内容view 和 菜单view的。只留一个菜单的删除按钮。这种情况就没考虑

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="45dp"
    android:orientation="vertical">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="horizontal">

        <Space
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1" />

        <TextView
            android:id="@+id/delete"
            android:layout_width="90dp"
            android:layout_height="match_parent"
            android:background="#f63f3f"
            android:gravity="center"
            android:text="删除"
            android:textColor="#ffffff" />

        <TextView
            android:id="@+id/more"
            android:layout_width="90dp"
            android:layout_height="match_parent"
            android:background="#fed494"
            android:gravity="center"
            android:text="更多"
            android:textColor="#ffffff"
            android:visibility="gone" />
    </LinearLayout>

    <TextView
        android:id="@+id/list_item"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#ffffff"
        android:clickable="true"
        android:gravity="center_vertical" />
</FrameLayout>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants