Peter Berkenbosch Peter Berkenbosch - 1 year ago 89
Android Question

Android set View.GONE does not "release" space in listview

I have a listview with some items that can be marked as "done". There is also a togglebutton that says "hide done items".

However, when I do hide the items by setting setVisibility(View.GONE) there is still space left in the list..

Should not be that hard to toggle list items in a listview?

Answer Source

Changing the android:layout_height="wrap_content" to android:layout_height="fill_parent" fixed the issue.. was testing with a long list.. with a short list the same space was above the list.. Stupid mistake..

Thanks all for help.. everything is working now.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download