相关疑难解决方法(0)

在RecyclerView的末尾添加空间

我有一个带有gridlayout的recyclerview.我想要的是当用户滚动到列表的末尾时(请参阅我的坏模型),应该有一个高度为50dp的空白空间,这与我的网格尺寸不同.

请注意,此空间仅在最末端可见,因为我不想更改布局.我可以这样做,以便recycerview的边距为50dp,但我不想这样做.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:fab="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.v7.widget.RecyclerView
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:id="@+id/recyclerView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".MainActivity"
        android:scrollbars="vertical"
        />

</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

android android-layout android-gridlayout android-recyclerview

36
推荐指数
3
解决办法
1万
查看次数