带有 RecyclerView 的 Android BottomSheet

标签 android android-recyclerview bottom-sheet

我在我的应用程序中添加了一个带有 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/

相关文章:

java - 如何使用 onClick 监听器将字符串从 TextView 传输到主 Activity

flutter - 如何在 flutter 中动态降低 bottomsheet 高度?

java - Android在使用捏缩放和临时图像调整文本大小时限制大小

屏幕关闭时 Android Wakelock 不工作

android - AlertDialog EditText 输入验证不起作用

java - 单击 RecyclerView 项目时调用 fragment 并将它们都显示在同一个 Activity 中

android - 加载数据时 RecyclerView 滚动到底部

android - 如何将动画添加到 BottomSheetDialogFragment

reactjs - React Native - Bottom Sheet 始终显示在安装上

android - 如何检查大于 android N 的构建版本