我在使用折叠工具栏时遇到了一些问题。我有以下布局结构
<CoordinatorLayout>
<AppbarLayout>
<CollapsingToolbar>
<NestedScrollView>
<HorizontalRecyclerView>
</NestedScrollView>
</CoordinatorLayout>
只有当我试图滚动我的NestedScrollView
触摸HorizontalRecyclerView
时才会出现问题。在那种情况下,CollapsingToolbar
不会崩溃。只是AppbarLayout
留在它的位置和NestedScrollView
滚动下它。我附上了一个视频,一切都很清楚。有谁能解释这个问题?谢谢。
这个问题可以通过将setNestedScrollingEnabled(false)
添加到内部HorizontalRecyclerView
来解决。