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
Attention! Correct way to calculate height is not
params.height = getCount() * (old_count > 0 ? getChildAt(0).getHeight() : 0);
We have to add height of each (minus one) divider heights.
if(oldCount > 0 && getCount() > 0)
params.height = getCount()
* (getChildAt(0).getHeight() + getDividerHeight())
- getDividerHeight();
else
params.height = 0;