我在我的应用程序中添加了一个带有 RecyclerView 的 BottomSheet,但我无法滚动 RecyclerView,而且我无法找出问题所在。
这是我的 Bottom Sheet :
<!-- bottom sheet -->
<FrameLayout
android:id="@+id/bottom_sheet"
style="@style/Widget.Design.BottomSheet.Modal"
android:layout_width="match_parent"
android:layout_height="0dp"
app:behavior_hideable="true"
app:behavior_peekHeight="90dp"
app:layout_behavior="@string/bottom_sheet_behavior">
<!-- horizontal thumbnail -->
<android.support.v7.widget.RecyclerView
android:id="@+id/horizontal_thumbnail"
android:layout_width="match_parent"
android:layout_height="90dp"/>
<!-- vertical thumbnail -->
<android.support.v7.widget.RecyclerView
android:id="@+id/vertical_thumbnail"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"/>
</FrameLayout>
垂直缩略图在工作表展开时可见,水平缩略图在列表折叠时可见。
最佳答案
解决了。问题是我向 BottomSheet 添加了两个 RecyclerViews,在这种情况下第二个没有滚动。我真的不需要第一个,当我删除它时,我可以滚动另一个。
关于带有 RecyclerView 的 Android BottomSheet,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40789606/