Android Support Library rev 23.2 and RecyclerView

前端 未结 1 828
梦谈多话
梦谈多话 2020-12-07 04:52

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条回答
  • 2020-12-07 05:21

    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.

    0 讨论(0)
提交回复
热议问题