从活动中删除查看 [英] Removing a View from an Activity
本文介绍了从活动中删除查看的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您已经有了在布局文件中定义的视图。如何从你的活动code去除呢?
解决方案
的ViewGroup VG =(ViewGroup中)(myView.getParent());
vg.removeView(MyView的);
应该做你想要尽可能正确地删除从活动视图是什么。在其他人的回答只会让查看看不见的,使用的资源。
You've got a View defined in a layout file. How do you remove it from you Activity code?
解决方案
ViewGroup vg = (ViewGroup)(myView.getParent());
vg.removeView(myView);
should do what you want as far as correctly removing the View from the Activity. The other guys' answer will just make the View invisible, using up resources.
这篇关于从活动中删除查看的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文