Hide All Controls in a layout
I have a layout with at least 40 controls, including TextView, Spinners .. etc. ..
I need some function to hide all controls.
can be iterated with a control loop in a given layout? Set the visibility to an invisible?
for example 开发者_如何转开发something like:
For Each ctl AS Control in Layout
ctl.Setvisibility(View.INVISIBLE)
Next
Thanks in advance.
It will be better to hide parent, but if you prefer you can hide only childs
for(int index=0,length=ctrl.getChildCount();index<length;++index)
{
View view = ctrl.getChildAt(index);
view.setVisibility(View.GONE)
}
You can Hide the parent layout of all this control
精彩评论