无法在协调器布局中使用Expandable RecyclerView。

时间:2017-11-25 23:40:33

标签: android expandablerecyclerview

从图像中可以看出,Recyclerview的两个组元素之间存在差距,它将展开以显示其子项目。

As you can see from the image there is a gap between two group elements of Recyclerview which will expand to show its child items.

展开时

When expanded

代码

<!-- language: ANDROID - XML-->
 <android.support.v4.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        android:scrollbars="vertical"
        android:layout_gravity="fill_vertical"
        >

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

            <android.support.v7.widget.RecyclerView
                android:id="@+id/expandable_recycler_menu"
                android:layout_width="match_parent"
                android:layout_height="match_parent">

            </android.support.v7.widget.RecyclerView>

        </LinearLayout>
    </android.support.v4.widget.NestedScrollView>

0 个答案:

没有答案