Android RecyclerView 设置显示滚动条属性后,滚动条不显示踩坑记录
踩坑记录:
RecyclerView的父容器为FrameLayout,FrameLayout相关属性如下:
android:layout_width="@dimen/dimen_358px"
android:layout_height="match_parent"
android:background="@drawable/sidebar_classic"
RecyclerView要求显示滚动条,相关属性如下
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dimen_80px"
android:fadeScrollbars="false"
android:scrollbarSize="3px"
android:overScrollMode="never"
android:scrollbarThumbVertical="@drawable/shape_scrollbar_ver"
android:scrollbars="vertical"
运行项目到机器上面,RecyclerView的滚动条无法显示(然后csdn查,百度查等等查都没找到相关的内容/*可能是关键字不对*/,于是。。。)
思考:控件属性正常,RecyclerView内的item可以点击操作,不存在被其他透明View遮盖的情况;
解决流程:给RecyclerView添加背景色,查看实际的控件显示范围(水平低,还不自信,总对自己写的属性没信心,相信眼见为实),添加背景色后,运行到机器上,我靠,滚动条出来了,所以滚动条不显示跟背景有关系(WTF),因为项目问题,不能直接将FramenLayout的背景直接调整到RecyclerView中,于是在RecyclerView的属性中添加:android:background="@color/transparent",运行验证,完美~
工作踩坑记录 随缘记录 Ⅰ
更多相关文章
- android xml控件属性
- EditText 所有属性
- Edittext设置输入属性,包括使用代码设置
- Android 之 EditText属性用法介绍
- Android 5.0 默认水波纹背景属性,可设置任何View
- RelativeLayout用到的一些重要的属性(自己在网上找的)
- android TextView属性汇总