//声明并实例化LayoutInflater LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View vi = inflater.inflate(R.layout.main, null); //vi就是main这个布局生成的View,在需要的地方添加使用 相关文章: 2021-07-21 2022-12-23 2022-12-23 2021-11-30 2021-10-05 2021-06-02 2022-12-23 2022-12-23