Hiding views in RecyclerView

There is no built in way to hide a child in RV but of course if its height becomes 0, it won’t be visible :). I assume your root layout does have some min height (or exact height) that makes it still take space even though it is GONE.

Also, if you want to remove a view, remove it from the adapter, don’t hide it. Is there a reason why you want to hide instead of remove ?

Leave a Comment