Recyclerview Takes Lots Of Space From Top After Use Spannedgridlayoutmanager
i want to show list data in SpannedGridLayoutManager in recycleview, but after add helper class SpannedGridLayoutmanager, in my recycleview take a lot of space in top iam has to tr
Solution 1:
Try wrapping your RecyclerView
inside a LinearLayout
:
...
<androidx.swiperefreshlayout.widget.SwipeRefreshLayoutandroid:id="@+id/swipeRefreshLayout"android:layout_width="match_parent"android:layout_height="match_parent"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="match_parent"><androidx.recyclerview.widget.RecyclerViewandroid:layout_width="match_parent"android:id="@+id/feed_home"android:windowSoftInputMode="adjustResize"tools:listitem="@layout/item_feed_home"android:layout_height="match_parent"tools:ignore="MissingConstraints"/></LinearLayout></androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
...
Solution 2:
cause your height is match_parent replace with android:layout_height="wrap_content"
Post a Comment for "Recyclerview Takes Lots Of Space From Top After Use Spannedgridlayoutmanager"