1、当程序中含有一大批Textiew控件,出于简便,可以

private TextView[] mcourse;


mcourse=new TextView[25];//25个textview对象
        for(int i=0;i<25;i++){
            mcourse[i]=(TextView)this.findViewById(R.id.textview1+i);//要求在布局中是相邻的
            mcourse[i].setText(str[i]);//一次从一个字符串数组赋值
        }

2、字符串数组

String[] str={"","","",""};//第一次声明时就必须赋值

3

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-12
  • 2022-12-23
  • 2021-12-16
  • 2021-06-08
猜你喜欢
  • 2021-09-01
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2021-09-10
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案