Я обнаружил, что мой последний элемент в RecyclerView
не может отображаться, когда RecyclerView
внутри GridLayot
.
Я пытаюсь удалить GridLayot
и просто использовать RecyclerView
, и он может показатьвсе предметы, но я не могу использовать это решение, потому что мне тоже нужно показать мой AppBarLayout
. Поэтому мне нужно использовать GridLayot
, чтобы AppBarLayout
и RecyclerView
были группой, а SwipeRefreshLayout
можно использовать.
Как это можно исправить, спасибо!
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorWhite">
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/activity_cost_diamond_history_swipe_refresh"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorComtGray">
<GridLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:columnCount="1"
android:rowCount="2">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginTop="15dp"
android:layout_marginBottom="15dp"
android:layout_row="0">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_gravity="center"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:id="@+id/activity_cost_diamond_history_user_cost_diamond_icon"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginRight="5dp"
android:src="@drawable/ic_point" />
<TextView
android:id="@+id/activity_cost_diamond_history_user_cost_diamond_text"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:gravity="center"
android:textColor="@color/colorBlack"
android:textSize="17sp" />
</LinearLayout>
</com.google.android.material.appbar.AppBarLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/activity_cost_diamond_history_recycler"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical" />
</GridLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</RelativeLayout>