我在一个NestedScrollView
中布局了一个RecyclerView
,希望能够滑动NestedScrollView
时也跟着滑动RecyclerView
,但只有当RecyclerView
滑动到底部时才会出现这种情况,以下是我的布局代码:
<android.support.v4.widget.NestedScrollView
android:id="@+id/lists_frame"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:animateLayoutChanges="true"
tools:context="com.example.niuky.design.MainActivity4"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<View
android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="256dp"
android:background="@color/material_blue_grey_800"
/>
<View
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="?android:attr/actionBarSize"
android:background="@color/material_blue_grey_950"
/>
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerview2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:minHeight="700dp"
/>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
这是我的运行时视图:
CoordinatorLayout
和AppBarLayout
,但是我没有得到我想要的结果。你有什么想法吗?非常感谢! - KevinNestedScrollView
应该允许我们这样做...但是,就像谷歌最近的做法一样,根本没有文档。 - mato