I have a Recyclerview which is working fine with the Android version 23 but if i am running the same code with the Android version 25 then the whole screen is occupied by the single item.
Initially the list looks fine where the item height is wrap content. But as i scroll the whole screen is occupied by single item.
Below is my layout containing RecyclerView:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="vertical">
<android.support.v7.widget.RecyclerView
android:id="@+id/my_recycler_view"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:scrollbars="vertical" />
</LinearLayout>
Your Recyclerview code is ok. if you are using TextView or else in your iteam_raw.xml then make sure you give "wrap_content"
iteam_raw.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
Please use recyclerview item's main layout height "wrap_content".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With