Search code examples
androidandroid-recyclerviewandroid-coordinatorlayoutandroid-appbarlayout

Recyclerview Height cutoff


This is the structure of my layout:

<ScrollView
-height - match>
<CoordinatorLayout
-height - wrap>
<AppbarLayout
-height - wrap>
<CollapsingToolbarLayout
-height - wrap>
<ConstraintLayout>
//min height is set dynamically.
</ConstraintLayout>
</CollapsingToolbarLayout>
</AppbarLayout>
<RecyclerView
->scroll behaviour
->height-wrap/>
<CoordinatorLayout>
</ScrollView>

because the scroll view is present I cannot apply the min-height in collapsing toolbar layout. is there any way we can adjust the height(here my recycler view gets cutoff)


Solution

  • Add this property to recylerview app:layout_constrainedHeight="true".

    See the following for more details Last Item in recyclerview is cut off