问题描述
我有一个可以被标记为完成一些项目列表视图。还有一个切换按钮,上面写着隐藏完成的项目。
I have a listview with some items that can be marked as "done". There is also a togglebutton that says "hide done items".
然而,当我这样做隐藏物品通过设置setVisibility(View.GONE)仍有剩余空间在列表中。
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?
推荐答案
更改安卓layout_height =WRAP_CONTENT到Android:layout_height =FILL_PARENT固定的问题..是测试用一个长长的名单。与短列出同一空间在名单上面..愚蠢的错误。
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.
这篇关于Android的设置View.GONE不"发布"在列表视图空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!