【发布时间】:2013-01-17 23:58:49
【问题描述】:
在我的应用程序中加载活动时,我正在执行以下操作
setContentView(R.layout.main2);
layoutToAdd = (LinearLayout) findViewById(R.id.linearLayout1);
for(i=0; i<num;i++)
{
LayoutInflater inflater = LayoutInflater.from(getApplicationContext());
View view = inflater.inflate(R.layout.camera, null);
layoutToAdd.addView(view);
}
num的值每次都不一样。
在我的 LayoutInflater 布局中,我有一个文本视图、编辑文本和一个按钮。
现在它们根据num 中提到的次数显示,现在每次我想要更改文本和按钮名称。如何设置 TextView 和 Button 的文本。
【问题讨论】: