Changing the height of the items in a ListView

view story

http://stackoverflow.com – I'm designing an application to browse miscellaneous source code. To browse the lines i chose to put them into a ListView. I've already built my custom Adapter to handle custom item layout. All the heights are set to wrap_content, but android doesn't seem to care about that, there's an annoying blank space between the lines. Image If I manually set the height value in layoutParams programmatically to a fixed value, i.e. 30, the problem is "fixed", but I find this solution ugly and want to understand the reason of this unwanted spacing. Here's my Layout: <LinearLayout xmlns:android="htt (HowTos)