1、LayoutInflater inflater=LayoutInflater.from(this);
2、LayoutInflater inflater=getLayoutInflater();
3、LayoutInflater inflater=(LayoutInflater)this.getSystemService(LAYOUT_INFLATER_SERVICE);
本文介绍了LayoutInflater在Android开发中的三种常见使用方式,通过LayoutInflater可以从XML文件中加载布局资源,并将其转换为View对象,以便在应用程序中使用。
1、LayoutInflater inflater=LayoutInflater.from(this);
2、LayoutInflater inflater=getLayoutInflater();
3、LayoutInflater inflater=(LayoutInflater)this.getSystemService(LAYOUT_INFLATER_SERVICE);
2219

被折叠的 条评论
为什么被折叠?