【发布时间】:2015-02-07 04:25:50
【问题描述】:
我有一个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>
【问题讨论】:
-
这看起来是正确的。您确定没有主题问题或任何使滚动条与背景颜色相同的问题吗?有没有我们可以查看的示例项目?
-
@Michael Schmidt 这应该可以,只要记住当你想用
recyclerview显示scrollbar时总是使用android:scrollbars="vertical" -
也许您需要将
android:scrollbarStyle="outsideOverlay"添加到您的RecyclerView。 -
你解决了吗?
-
找到一篇关于滚动条样式的好文章(同时适用于滚动条和 RecyclerView)...androidopentutorials.com/android-vertical-scrollbar-styling
标签: android android-layout android-recyclerview android-scrollbar