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?
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.
Are you trying to hide the whole list item? If so I guess that the list view won't like that because it is still calculating with the same amount of items. I don't think it will just ignore it because it's gone.
The clean solution would be to return another getCount
and just ignore the items you want to hide. Or remove items from the internal used list. Call notifyDataSetChanged
on the adapter when you modified the amount of items in the list.
you should operate on the list adapter also...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With