我想在 android 中动态隐藏 framelayout,我该如何实现。
最佳答案
通过在 xml 文件中将它定义为您的 frameLayout 提供一个 id 属性:
android:id="@+id/someID"
在代码中,写下:
FrameLayout layout = (FrameLayout)findViewById(R.id.someID);
layout.setVisibility(View.GONE);
你也可以使用
View.INVISIBLE
这意味着该元素将仍然存在。
关于android - 如何在android中动态隐藏framelayout,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11209354/