private void findEditText(ViewGroup group) { if (group != null) { for (int i = 0, j = group.getChildCount(); i < j; i++) { View child = group.getChildAt(i); if (child instanceof EditText) { EditText child1 = (EditText) child; if (isNeed(child1.getText().toString()))//根据需求判断是否添加 continue; edList.add(child1); } else if (child instanceof ViewGroup) { findEditText((ViewGroup) child); } } } }
转载请标明出处:遍历找到layout中的某种控件
文章来源: 遍历找到layout中的某种控件