Android Support Library rev 23.2 and RecyclerView

删除回忆录丶 提交于 2019-12-17 17:10:11

问题


Updated to Android Support Library rev 23.2 and it added full screen spaces to RecyclerView between each item. Has anybody experienced this issue?


回答1:


This occurs when your RecyclerView rows have their size set to match_parent in the scrolling direction.

For example, if a RecyclerView with a vertical LinearLayoutManager has the following layout for each row, that row will now actually match the parent's height now. Before version 23.2.0 it would still simply wrap the content.

<View
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

In this case, changing the height to wrap_content will resolve the issue.

This issue is mentioned briefly in the announcement blog post:

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.



来源:https://stackoverflow.com/questions/35638638/android-support-library-rev-23-2-and-recyclerview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!