android 返回布局View

话说xml布局就是view?不理解:

三种方式可以生成LayoutInflater:

LayoutInflater inflater=LayoutInflater.from(this);
LayoutInflater inflater=getLayoutInflater();
LayoutInflater inflater=(LayoutInflater) this.getSystemService(LAYOUT_INFLATER_SERVICE);

然后调用inflate方法将xml布局文件转成View   

public View inflate(intresource,ViewGrouproot,booleanattachToRoot)
//在View类中,也有inflate方法
public static View inflate(Contextcontext,intresource,ViewGrouproot)

 

Leave a Reply

Your email address will not be published. Required fields are marked *