Android:RecyclerView填充阻止全屏体验

Android:RecyclerView填充阻止全屏体验,android,android-layout,android-recyclerview,Android,Android Layout,Android Recyclerview,我想在我的recycler视图中添加一些填充,这样状态栏就不会覆盖第一项。问题是,当我应用顶部填充时,顶部会显示一个纯白,以防止出现全屏体验 以下是我的布局: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" andro

我想在我的recycler视图中添加一些填充,这样状态栏就不会覆盖第一项。问题是,当我应用顶部填充时,顶部会显示一个纯白,以防止出现全屏体验

以下是我的布局:

    <?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/root_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.v7.widget.RecyclerView
        android:id="@+id/RecentVizzyView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:paddingTop="48dp" />

    <ProgressBar
        android:id="@+id/progressbar"
        android:layout_width="65dp"
        android:layout_height="65dp"
        android:layout_gravity="center"
        android:indeterminate="true"
        android:indeterminateTint="@color/lightGreen"
        android:indeterminateTintMode="src_atop" />

</android.support.design.widget.CoordinatorLayout>

在您的RecyclerView上设置android:CliptopPadding=“false”

这将允许paddingTop(和bottom,如果您愿意)成为可滚动部分的一部分

这里有更好的描述:

如果这样做行得通,我会感到惊讶,因为CliptPadding必须设置在RecyclerView父级上,而不是设置在RecyclerView本身上。谢谢你修复了它:)我刚刚将它添加到上面的RecyclerView中,列表现在可以滚动到凹口后面,而没有白色的东西。@ror不,它必须设置在RecyclerView本身上。RV具有填充,是一个视图组。clipToPadding告诉ViewGroups子对象可以使用填充空间进行滚动。在这种情况下,子元素是RV中的列表元素。
getActivity().getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);