在Android上的应用程序运行在布局控件处理 [英] Disposing of controls in a layout at runtime on android application

查看:141
本文介绍了在Android上的应用程序运行在布局控件处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要重置布局,或根据一定的情况下,配置一些控制上的布局。但我无法找到一个方法来做到这一点。你有关于如何做一个想法?

I need to reset a layout or dispose some of the controls on that layout according to some certain cases. But I couldn't find a way to do so. Do you have an idea about how to do?

先谢谢了。

推荐答案

也许你可以只隐藏的组件,例如 findViewById(R.id.the_id_of_the_view_to_hide).setVisibility(View.GONE);

Maybe you can just the hide the components, e.g. findViewById(R.id.the_id_of_the_view_to_hide).setVisibility(View.GONE);

有用于能见度不同的参数。 GONE 隐藏的观点,也腾出了空间,就好像是完全去除之前使用的视图。

There are different parameters for the visibility. GONE hides the view and also frees up the space, the view used before, as if it was removed completely.

这篇关于在Android上的应用程序运行在布局控件处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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