//声明并实例化LayoutInflater LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View vi = inflater.inflate(R.layout.main, null); //vi就是main这个布局生成的View,在需要的地方添加使用
引入xml布局文件
最新推荐文章于 2024-05-14 11:18:30 发布