滚动条未在RecyclerView中显示 [英] Scrollbar not showing in RecyclerView

查看:203
本文介绍了滚动条未在RecyclerView中显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I've got a RecyclerView and would like to have scrollbar showing, when it covers more than one page.

我根本没有滚动条.有什么主意吗?

I get no scrollbar at all. Any idea?

我的布局:

<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布局中设置垂直(或水平)滚动条:

The solution is to set the vertical (or horizontal) scrollbar in the xml layout:

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

这篇关于滚动条未在RecyclerView中显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆