进去的LinearLayout所有子视图一次 [英] Get all child views inside LinearLayout at once
本文介绍了进去的LinearLayout所有子视图一次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个的LinearLayout
,其中包含几个子 TextViews
。我怎样才能像LinerLayout的使用循环孩子的意见?
I have a LinearLayout
, which contains several child TextViews
. How can I get child views of that LinerLayout using a loop?
推荐答案
使用 getChildCount()
也 getChildAt()
像这可能是
int childcount = ll.getChildCount();
for (int i=0; i < childcount; i++){
View v = ll.getChildAt(i);
}
这篇关于进去的LinearLayout所有子视图一次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文