-
截取部分项目demo 循环获取RecyclerView item 的 RelativeLayout 下面的 TextView 和 EditText 的 值 ,以键值对形式保存 ArrayList<Map<String, String>> houseRes = new ArrayList<>(); RecyclerView recy = findViewById(R.id.recy_setting); for (int i = 0; i < recy.getChildCount(); i++) { Map<String, String> mDeviceHeaderMap = new HashMap<>(); RelativeLayout layout = (RelativeLayout) recy.getChildAt(i); TextView tv_content = layout.findViewById(R.id.tv_content); EditText tv_description = layout.findViewById(R.id.tv_content_description); mDeviceHeaderMap.put(tv_content.getText().toString(), tv_description.getText().toString()); houseRes.add(mDeviceHeaderMap); }
循环 获取RecyclerView item 控件 及数据
猜你喜欢
转载自blog.csdn.net/GodnessIsMyMine/article/details/81910415
今日推荐
周排行