答案 0 :(得分:0)
edittext.xml
Allocates an array of a given type, but does not do zeroing.
main.xml中
@ForceInline
private static byte[] newArray(int length, byte coder) {
return (byte[]) UNSAFE.allocateUninitializedArray(byte.class, length << coder);
}
main.java
<?xml version="1.0" encoding="utf-8"?>
<EditText xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/edittext"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="your hint" />
您可以像
那样动态地展开edittext答案 1 :(得分:0)
LinearLayout layout=(LinearLayout)view.findViewById(R.id.linearLayout);
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
android.widget.LinearLayout.LayoutParams.MATCH_PARENT,
android.widget.LinearLayout.LayoutParams.WRAP_CONTENT);
EditText edttext= new EditText(this);
edttext.setId("edittext");
edttext.setLayoutParams(params);
layout.addView(edttext);
检查一下......
答案 2 :(得分:0)
创建根布局对象
LinearLayout layout = (LinearLayout) findViewById(R.id.linearLayout);
点击EditText
Button
进行套道
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
android.widget.LinearLayout.LayoutParams.MATCH_PARENT,
android.widget.LinearLayout.LayoutParams.WRAP_CONTENT);
EditText edttext= new EditText(this);
edttext.setId("et_somthing");
edttext.setLayoutParams(params);
然后使用您的布局添加EditText
..
layout.addView(edttext);