猿问

我的回收站视图没有显示它拥有的所有项目,我该如何解决?

我的 recyclerView 有问题。它不显示所有项目。例如,recyclerView 有 12 个项目,但显示为 10 个项目。我可以为它设置 paddingBottom,它会显示所有项目,但我认为这不是一个好方法。我该如何解决?我想也许是因为我上面的按钮。


acctivity_search_coin.xml


<?xml version="1.0" encoding="utf-8"?>

<android.support.constraint.ConstraintLayout

    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:layout_width="match_parent"

    android:layout_height="match_parent">



    <android.support.v7.widget.RecyclerView

        android:id="@+id/recyclerView2"

        android:layout_width="match_parent"

        android:layout_height="wrap_content"

        android:layout_marginTop="8dp"

        android:paddingBottom="50dp"

        app:layout_constraintTop_toBottomOf="@+id/lianerForThreeBtn" />


    <Button

        android:id="@+id/button2"

        android:layout_width="match_parent"

        android:layout_height="wrap_content"

        android:layout_marginStart="8dp"

        android:layout_marginTop="8dp"

        android:layout_marginEnd="8dp"

        android:background="#FFFFFF"

        android:paddingStart="5dp"

        android:paddingEnd="5dp"

        android:textSize="15sp"

        android:drawablePadding="6dp"

        android:gravity="center_vertical"

        app:layout_constraintEnd_toEndOf="parent"

        app:layout_constraintStart_toStartOf="parent"

        app:layout_constraintTop_toTopOf="parent" />


    <LinearLayout

        android:id="@+id/lianerForThreeBtn"

        android:layout_width="match_parent"

        android:layout_height="wrap_content"

        android:orientation="horizontal"

        app:layout_constraintTop_toBottomOf="@+id/button2">


        <Button

            android:id="@+id/btn1"

            android:layout_width="0dp"

            android:layout_height="wrap_content"

            android:background="#FFFFFF"

            android:layout_weight="1"/>


一只斗牛犬
浏览 124回答 1
1回答

开心每一天1111

尝试添加app:layout_constraintBottom_toBottomOf="parent"回收站视图,并将回收站视图的高度设置为 0dp(匹配约束)。
随时随地看视频慕课网APP

相关分类

Java
我要回答