1.ViewStub标签类似include标签,导入布局文件.加载ViewStub的时候,其指定的布局不会被加载到内存中.只有在代码中调用 inflater().才会显示指定的布局.并且调用inflater以后,布局对象中就不存在ViewStub
ViewStub viewStub = (ViewStub)findViewById(R.id.view_stub_id);
viewStub.inflate();
ViewStub viewStub = (ViewStub)findViewById(R.id.view_stub_id);
viewStub.inflate();