Android的设置View.GONE不"发布"在列表视图空间 [英] Android set View.GONE does not "release" space in listview

查看:241
本文介绍了Android的设置View.GONE不"发布"在列表视图空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个可以被标记为完成一些项目列表视图。还有一个切换按钮,上面写着隐藏完成的项目。

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不"发布"在列表视图空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆