StupidBeauty
Read times:802Posted at:Sat Feb 23 19:09:17 2013
- no title specified

转载Android中利用LinearLayout动态添加控件 - Androider的专栏 -...

LinearLayout.addView (View View2Add) 方法可用于 将控件动态地添加到线性布局器中。

http://www.360doc.com/content/10/1108/15/3234041_67645225.shtml

亮点:

final LinearLayout layout2=new LinearLayout(this);
06. layout2.setOrientation(LinearLayout.VERTICAL);
07. Button btn1=new Button(this);
08. setContentView(layout2);
09. Button btn2=new Button(this);
10. btn1.setText("Button1");
11. btn2.setText("Button2");
12. layout2.addView(btn1);

遍身罗绮者,不是养蚕人

Your opinions
Your name:Email:Website url:Opinion content: