I am currently trying to use a ListView inside of a ScrollView. I know from what I\'ve read that this is looked down upon, but I\'m trying to get the ListView to expand com
I know it's late and there is already and answer but if you really want to do this there is an easy way:
Create the list view Item with a defined height
Now we know that the Item is 100dp
high, and if we know the number of items then it is very simple
set the ListView
height literally to the value of NoOfItems
*Height
+ 10dp
extra
It will never change since all unites are in dp
.
If you have more than 1 item type then calculate it with basic math and set it