Why are these recyclerview items not filling their views?

335

Found the issue: In my viewholder I set certain layouts as invisible and since the views are recycled they weren't showing. All I had to do was set them to visible.

From this solution https://stackoverflow.com/a/29325270/6136947

Share:
335

Related videos on Youtube

Evan Radcliffe
Author by

Evan Radcliffe

Updated on December 03, 2022

Comments

  • Evan Radcliffe
    Evan Radcliffe over 1 year

    I have a horizontal RecyclerView inside a NestedScrollView inside a SwipeRefreshLayout. Presumably this is a cause for error. When I load the data the children display fine but once I scroll to an end and rescroll the children aren't filling their views.

    In action

    I've found a bunch of different advice on how to fix this with layout constraints, different parent view types, and changing focus but the problem still occurs. onBindViewHolder is definitely getting called but for some reason the binding doesn't happen?