我的 recyclerView 有問題。它不顯示所有項目。例如,recyclerView 有 12 個項目,但顯示為 10 個項目。我可以為它設(shè)置 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"/>
1 回答

開心每一天1111
TA貢獻1836條經(jīng)驗 獲得超13個贊
嘗試添加app:layout_constraintBottom_toBottomOf="parent"
回收站視圖,并將回收站視圖的高度設(shè)置為 0dp(匹配約束)。
添加回答
舉報
0/150
提交
取消