只需添加内部的LinearLayout(垂直)报头视图+ recyclerview +页脚视图android.support.v4.widget.NestedScrollView。
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<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="wrap_content"/>
<android.support.v7.widget.RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layoutManager="LinearLayoutManager"/>
<View
android:id="@+id/footer"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
添加这行代码以平滑滚动
RecyclerView v = (RecyclerView) findViewById(...);
v.setNestedScrollingEnabled(false);
http://stackoverflow.com/questions/26448717/android-5-0-add-header-footer-to-a-recyclerview