我得到了以下结构:
现在的问题是,当我向下滚动列表时,工具栏会正确地折叠。但当工具栏完全折叠时,就不再滚动了,我无法想出如何实现这一点。
对于每个RecyclerView,我都使用一个启用了AutoMeasureEnabled的LinearLayoutManager。此外,HasFixedSize标志设置为false。
有什么想法吗?
//编辑:内容不固定;它通过reactiveUI传递进来。
<CoordinatorLayout>
<AppBar>
<CollapsingToolbar
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"/>
</AppBar>
<NestedScrollView
android:layout_height="wrap_content"
android:fillViewport="true"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<ViewPager />
</NestedScrollView>
</CoordinatorLayout>
ViewPager中的片段如下:
<LinearLayout
android:layout_height="wrap_content">
<RecyclerView
android:layout_height="wrap_content" />
</LinearLayout>
在这个片段的RecyclerView中,我得到了
<RelativeLayout
android:layout_height="wrap_content">
<...>
<RecyclerView
....
android:layout_height="wrap_content" />
</RelativeLayout>
现在的问题是,当我向下滚动列表时,工具栏会正确地折叠。但当工具栏完全折叠时,就不再滚动了,我无法想出如何实现这一点。
对于每个RecyclerView,我都使用一个启用了AutoMeasureEnabled的LinearLayoutManager。此外,HasFixedSize标志设置为false。
有什么想法吗?
//编辑:内容不固定;它通过reactiveUI传递进来。