android动态添加TextView或者ImageView

动态添加
text1=new TextView(this);
text1.setText("动态添加");
((LinearLayout) this.findViewById(R.id.layout)).addView(text1);

//引用资源文件
text2=(TextView)this.findViewById(R.id.textView1);
String a="56788997";
text2.setText(a);

posted @ 2014-01-18 03:31  zmiao  阅读(585)  评论(0编辑  收藏  举报