Reputation: 4748
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.
Upvotes: 0
Views: 1606
Reputation: 1216
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)
}
Upvotes: 4