daimajia / AndroidSwipeLayout

The Most Powerful Swipe Layout!
MIT License
12.38k stars 2.67k forks source link

Why list item with a container, the item click disable? #232

Open ZacksTsang opened 9 years ago

ZacksTsang commented 9 years ago

I make a RelativeLayout contains SwipeLayout, so the ListView item click disable, what happen?

<?xml version="1.0" encoding="utf-8" ?>
<RelativeLayout
    xmlns:swipe="http://schemas.android.com/apk/res-auto"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">
    <com.daimajia.swipe.SwipeLayout
        android:id="@+id/swipe"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        swipe:leftEdgeSwipeOffset="0dp"
        swipe:rightEdgeSwipeOffset="0dp">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="80dp"
            android:background="#FF5534"
            android:gravity="center"
            android:tag="Bottom3"
            android:weightSum="10">

            <ImageView
                android:id="@+id/trash"
                android:layout_width="27dp"
                android:layout_height="30dp"
                android:layout_weight="1"
                android:src="@drawable/trash" />

            <TextView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="5"
                android:text="Delete Item?"
                android:textColor="#fff"
                android:textSize="17sp" />

            <Button
                android:id="@+id/delete"
                android:layout_width="0dp"
                android:layout_height="40dp"
                android:layout_weight="4"
                android:background="@drawable/white"
                android:text="Yes,Delete"
                android:textColor="#FF5534" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@drawable/item_selector"
            android:padding="10dp">

            <TextView
                android:id="@+id/position"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" />

            <TextView
                android:id="@+id/text_data"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:tag="Hover"
                android:text="Do not, for one repulse, forgo the purpose that you resolved to effort. " />
        </LinearLayout>
    </com.daimajia.swipe.SwipeLayout>
</RelativeLayout>
liu-xinhui commented 9 years ago

demo code is like yours,also cannot reponse onclick

ding102992 commented 9 years ago

It puzzle me for a long time.

liyuzhao commented 8 years ago

me too, Who solved this problem?