Nếu bạn muốn tạo chế độ xem động (như EditText, textview, v.v.) thì chỉ cần sử dụng mã này và chạy nó trong ứng dụng của bạn.
MyActivity.java://your java tập tin
LinearLayout ll = (LinearLayout)findViewById(R.id.linearLayout1);
EditText et = new EditText(v.getContext());
et.setText("My new Edit Text);
et.setMinLines(1);
et.setMaxLines(3);
ll.addView(et);
Trong XML File:
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignBottom="@+id/TextView01"
android:layout_below="@+id/relativeLayout1"
android:orientation="vertical" >
Nguồn
2014-06-04 15:38:18
Cảm ơn bạn sir :) đánh giá cao sự giúp đỡ của bạn –
buttonlayout là gì? làm thế nào để tạo ra rằng –