答案 0 :(得分:3)
您可以使用您的recyclerview,如下例所示:
<android.support.v4.widget.NestedScrollView
android:id="@+id/nestedScroll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_collapseMode="pin">
<!-- Some views-->
</LinearLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_bubhub_comment_list"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
如果您需要同时滚动布局,则可以在recyclerview中使用以下属性。否则它将作为单个滚动视图工作。这些属性允许Recyclerview
在NestedScrollView
app:layoutManager="android.support.v7.widget.LinearLayoutManager"
app:layout_behavior="@string/appbar_scrolling_view_behavior"