Tôi có bố trí và tôi muốn thổi phồng rằngInflater thổi phồng nhưng chiều cao là nhỏ (trông giống như wrap_content và cần fill_parent)
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<EditText
android:id="@+id/editText1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
</EditText>
</LinearLayout>
như
LinearLayout ll=(LinearLayout)findViewById(R.id.llContainer);
View view;
LayoutInflater inflater = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = inflater.inflate(R.layout.question_free_text, null);
ll.addView(view);
nơi ll là
<LinearLayout
android:id="@+id/llContainer"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
>
</LinearLayout>
trong xml khác, nhưng vấn đề là khi nó thổi phồng nó cho thấy nhưng chiều cao là lớn (fill_parent, nó trông giống như wrap_content, nhưng không có wrap_content trong bố trí). Ai có thể giúp tôi ?
có thể là vì những 2tags .. android: layout_marginTop = "20dp" android: layout_marginBottom = "20dp" – ngesh
thay thế null bằng chế độ xem gốc, trong khi tăng. –