Large gaps between crime list items

#1

I’m at the end of chapter nine, before the event listeners code listing, but the problem is that when I run the application, It displays the crimes with very large gaps (almost the screen height) in between each list item.

I changed the layout_height of the recyclerview to wrap_content instead of match_parent. It works fine, but the moment I start to scroll the list, the gaps comes back again.

What might be wrong?

#2

I have the exact same problem right now and I am not sure why

#3

I also had the same problem. There seems to be a mistake in figure 9.11. I think the RelativeLayout’s height property is supposed to be “wrap_content” instead of “match parent”.

#4

Yes, at least part of the problem is the row height. Check the errata post for more info: Second Edition Errata