// 将Layout文件转化为view对象
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = inflater.inflate(R.layout.activity_ju_releasemet, null);
只需这两行代码就可以将Layout文件转化为view对象。 在用到view对象的时候可以采取这种方法