我有以下内容:
<android.support.v7.widget.RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical" />
我添加这个是为了让 UI 更简洁:
android:paddingEnd="16dp"
android:paddingStart="16dp"
但是,现在滚动条位于填充内并且看起来很时髦。所以我补充说:
android:scrollbarStyle="outsideInset"
滚动条现在位于 padding 之外,但是,over scroll glow 仍然在 padding 之内。
如何让滚动发光延伸到内边距?
编辑:
这是遇到与上述相同问题的完整布局代码。
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent">
</android.support.v7.widget.RecyclerView>
最佳答案
您需要做的是将 android:clipToPadding="false"
应用到 RecyclerView
。考虑这个 xml:
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="40dp"
android:paddingBottom="40dp"
android:clipToPadding="false"/>
结果如下:
关于android - 改造滚动发光在填充之外,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42774320/