RecyclerView 中未显示滚动条 [英] Scrollbar not showing in RecyclerView
本文介绍了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屋!
查看全文