【关于Android】
麻烦问一下 如何在一个Activity里使用另一个xml布局文件 谢谢了
------解决思路----------------------
LayoutInflater factorys = LayoutInflater.from(当前类.this);
final View textEntryView = factorys.inflate(R.layout.你要获取的另一个XML, null);
TextView y_type = (TextView) textEntryView.findViewById(R.id.控件ID);
------解决思路----------------------
TextView y_type = (TextView) textEntryView.findViewById(R.id.控件ID);
都获取到控件了,你给y_type赋值,看下效果不就知道了
------解决思路----------------------
直接setcontentview()就行了啊
------解决思路----------------------
LayoutInflater.from(this).inflate(resource, root, attachToRoot);