在回收者视图下使按钮可单击

时间:2019-10-04 15:58:57

标签: android

嗨,我的布局如下:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:animateLayoutChanges="true"
    android:orientation="vertical">

    <com.widgets.AppSwipeRefreshLayout
        android:id="@+id/swipe_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:fitsSystemWindows="true">

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <com.widgets.AppRecyclerView
                android:id="@+id/recyclerView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:scrollbars="vertical"
                app:layoutManager="androidx.recyclerview.widget.GridLayoutManager" />

            <androidx.appcompat.widget.AppCompatButton
                android:elevation="0dp"
                android:id="@+id/test"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="left|start|center_vertical"
                android:clickable="true"
                android:descendantFocusability="beforeDescendants"
                android:focusable="true"
                android:focusableInTouchMode="true"
                android:text="TEST" />

        </FrameLayout>

    </com.widgets.AppSwipeRefreshLayout>

</LinearLayout>

我的回收者视图有2种类型的物品,1种是常规物品,1种具有透明背景以显示按钮的物品。我的问题是,当透明项目为屏幕且按钮可见时,按钮不接收点击事件。我以为可能是因为高程和高程改变了,但是并没有解决问题。如何制作按钮以接收点击事件?

0 个答案:

没有答案
相关问题