Recyclerview Items with Big Empty Space After 23.2.0

RecyclerView items with big empty space after 23.2.0

According to the doc

With the release 23.2.0 there is an exciting new feature to the LayoutManager API: auto-measurement!

This allows a RecyclerView to size itself based on the size of its contents. This means that previously unavailable scenarios, such as using WRAP_CONTENT for a dimension of the RecyclerView, are now possible.

You’ll find all built in LayoutManagers now support auto-measurement.

Due to this change, make sure to double check the layout parameters of your item views: previously ignored layout parameters (such as MATCH_PARENT in the scroll direction) will now be fully respected.

In your item layout you have to change:

android:layout_height="match_parent"

with

android:layout_height="wrap_content" 

RecyclerView v23.2.0 and blank space after swiping up

I found the bug.

In the layout file where the cardview is in, I had to modify the surrounding RelativeLayout's layout_height attribute to WRAP_CONTENT as well.

Interesting part is, I changed the layout_height of RecyclerView back to MATCH_PARENT and it still worked as desired.

RecyclerView items with very large empty space at bottom after updating to support library 23.2.1

Make sure your recycler view height is set to wrap_content. 23.2 introduced wrap content functionality for RecylerView and you should have the height as wrap_content if you want your RecyclerView work as it was working before.

Quote from Android Developers Blog

Due to this change, make sure to double check the layout parameters of
your item views: previously ignored layout parameters (such as
MATCH_PARENT in the scroll direction) will now be fully respected.

Android RecyclerView large gap space after some rows of items on tablet landscape

As noted in the answers for other questions mentioned above, changing from match_parent to wrap_content should solve the problem. But it does not, and if anyone can explain why I will accept that as the answer.

I have solved it with reversing back to match_parent for RecyclerView and relating layout heights, and setting setAutoMeasureEnabled(false) for GridLayoutManager (third line in the above getGridLayoutManager() function - just changed true to false).

RecyclerView items with big empty space v25.2.0

Alright, after a good night sleep and more stackoverflow/google search, I found the issue: I should call

imageView.setAdjustViewBounds(true);  

I committed the fix and the layout looks well.

RecyclerView space between items expanding when scrolling

Provide your Layout and RecyclerView code to help debug and not make a guess.

Ok so here is the issue:

With the release 2.3.0 there is an exciting new feature to the LayoutManager API: auto-measurement!
This allows a RecyclerView to size itself based on the size of its contents. This means that previously unavailable scenarios, such as using WRAP_CONTENT for a dimension of the RecyclerView, are now possible.
You’ll find all built in LayoutManagers now support auto-measurement.

Due to this change, make sure to double check the layout parameters of your item views: previously ignored layout parameters (such as MATCH_PARENT in the scroll direction) will now be fully respected.

Basically you need to remove the LinearLayout

<ImageView
android:id="@+id/imageView_slide"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_margin="5dp"
android:background="@android:color/darker_gray" />

The match_parent in the LinearLayout width is causing each item to fit the entire screen with one image and remaining space.

If you insist on using the LinearLayout, set both width and height to wrap_content

RecycleView set wrong height for items

Set wrap_content for the recyclerview and for your viewholder layout parent.
This worked for me.

Android recyclerview v.23.2.0 & design library v.23.2.0 are broken

The reason you are getting large open spaces is because of match_parent. It wasn't working correctly before, but now with the new release it is working differently. You just need to update to wrap_content instead of match_parent as that causes the layout to match the parent giving you the large spaces.

The RecyclerView widget provides an advanced and flexible base for creating lists and grids as well as supporting animations. This release brings an exciting new feature to the LayoutManager API: auto-measurement! This allows a RecyclerView to size itself based on the size of its contents. This means that previously unavailable scenarios, such as using WRAP_CONTENT for a dimension of the RecyclerView, are now possible. You’ll find all built in LayoutManagers now support auto-measurement.

http://android-developers.blogspot.co.uk/2016/02/android-support-library-232.html



Related Topics



Leave a reply



Submit