android - 滚动条未在 RecyclerView 中显示

标签 android android-layout android-recyclerview android-scrollbar

我有一个 RecyclerView,希望在滚动条覆盖多个页面时显示滚动条。

我根本没有滚动条。有什么想法吗?

我的布局:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <CheckBox
        android:id="@+id/cl_only_empty"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:elevation="5dp"
        android:text="@string/cl_only_empty"
        android:textColor="@color/white" />

    <android.support.v7.widget.RecyclerView
        android:id="@+id/callsList"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scrollbars="vertical" />

</LinearLayout>

最佳答案

解决方法是在xml布局中设置垂直(或水平)滚动条:

<android.support.v7.widget.RecyclerView
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:scrollbars="vertical" />

关于android - 滚动条未在 RecyclerView 中显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27376224/

相关文章:

java - 安卓横向设计

android - 检测 phonegap 中的假/模拟位置?

android - 在布局中创建不需要的空间

android - 如何以编程方式在 Android 中查找平板电脑或手机?

android - 回收器 View 滚动但未滚动到末尾

java - 如何显示列表的内容?

android - 为 android 打开街道 map api

android - 如何按中心点对齐 View ?

android - RecyclerView 双向无限滚动

java - 如何在 Android 中的 ListView 项目之前添加数字