想实现一个功能,在当前页面布局上再加载一个xml作为它的子类,最后终于找到了,谢谢作者们啊嘿嘿
// 加载子Layout
View mBarView = View.inflate(this, R.layout.main_panel, null);
// 找到容器
LinearLayout panel_center = (LinearLayout) findViewById(R.id.panel_center);
// 加上View 结束
panel_center.addView(mBarView);
本文介绍了一种在当前页面布局中加载另一个XML布局文件的方法。通过使用View的inflate方法将指定的XML资源转换为视图对象,并将其添加到现有的LinearLayout中。
1770

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



