java - Is there a way to find all View.GONE elements on a page? -
i have android application i'm hiding , showing different custom items on page. there way loop through items on page set view.gone or going have if each id?
thanks lot
to find hidden views, can like:
linearlayout parentlayout = (linearlayout) findviewbyid(r.id.parent_layout); int childviews = parentlayout.getchildcount(); list<view> hiddenviews = new arraylist<view>(); (int = 0; < childviews; i++) { view v = parentlayout.getchildat(i); if (v.getvisibility() == view.gone) { hiddenviews.add(v); } }
in example, list<view> hiddenviews
contain views visibility of view.gone
.
Comments
Post a Comment