foo.setVisibility(View.GONE)和parent.removeView(富)之间的区别 [英] Difference between foo.setVisibility(View.GONE) and parent.removeView(foo)

查看:355
本文介绍了foo.setVisibility(View.GONE)和parent.removeView(富)之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果foo是一个观点,就是 foo.setVisibility(View.GONE) fooParent.removeView(富)?我在视图中,前两个语句之后的内存消耗特别感兴趣。

If foo is a view, what is the difference between foo.setVisibility(View.GONE) and fooParent.removeView(foo)? I am particularly interested in memory consumption of the view, before and after both statements.

是否能见度期设置为GONE消耗内存?

Does a view with visibility set to GONE consume memory ?

推荐答案

如果您需要将其删除,然后再告诉他们,它可能是最好只设置能见度消失,然后再改回可见。

If you need to remove them and then show them again, it could be better to just set visibility to gone and then change back to visible again.

如果您在另一方面不要再需要它们可见,只需删除它们。

If you on the other hand don't need them visible again, simply remove them.

这篇关于foo.setVisibility(View.GONE)和parent.removeView(富)之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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