I printed out the image views getHeight() and getMeasuredHeight() and got 0 for both.
When I changed the span count for GridLayoutManager to 1, all images have correct height.
When I changed the span count to 3, only the last of the 1st row, first of 2nd row, last of 3rd row and so on have the correct image height.
My grid_item.xml
I printed out the image views
getHeight()
andgetMeasuredHeight()
and got 0 for both. When I changed the span count forGridLayoutManager
to 1, all images have correct height. When I changed the span count to 3, only the last of the 1st row, first of 2nd row, last of 3rd row and so on have the correct image height.