02 | private LinearLayout mLayout; |
03 | mLayout = (LinearLayout) findViewById(R.id.layout); |
06 | TextView textView = new TextView(Activity01. this ); |
07 | textView.setText( "Text View " ); |
10 | android:layout_width="fill_parent" |
11 | android:layout_height="wrap_content" |
12 | android:text="Text View"/>*/ |
15 | LinearLayout.LayoutParams p = new LinearLayout.LayoutParams( |
16 | LinearLayout.LayoutParams.FILL_PARENT, |
17 | LinearLayout.LayoutParams.WRAP_CONTENT |
20 | mLayout.addView(textView, p); |
转载于:https://www.cnblogs.com/yanzizhuang/p/3343971.html