首先使用 LayoutInflater mLi = LayoutInflater.from(this); view2 = mLi.inflate(R.layout.showfoodinfo_chefteach, null);加载layout下面的需要操作的XML文件,然后
showfoodinfo_chefteach_tv1 = (TextView) view2
.findViewById(R.id.showfoodinfo_chefteach_tv1);
showfoodinfo_chefteach_tv1.setText("测试");
就直接可以操作那个XML文件里的对应的控件了