I have three ListView
widgets in the same LinearLayout
. Something like this (I'm omitting XML elements that are not relevant in this example):
<LinearLayout>
<ListView
android:layout_width="fill_parent"
android:layout_height="360dp"/>
<ListView
android:layout_width="fill_parent"
android:layout_height="360dp"/>
<ListView
android:layout_width="fill_parent"
android:layout_height="360dp"/>
</LinearLayout>
This forces the list to have a height of 360 dip. Of course, that will be its height even if there are few list items. So, my question is how can make the lists have an automatic height? What I want is that the ListView
height takes the exact size of the sum of all its list items.