我的布局,我想夸大这打气筒充气,但高度小(貌似WRAP_CONTENT和需要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>
像
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);
其中,LL为
<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>
在其他XML中,但问题是当它膨胀它显示,但高度很大(fill_parent,它看起来像wrap_content,但没有wrap_content布局)。有谁能够帮助我 ?
可能是因为这些2tags的..机器人:layout_marginTop =“20dp” 机器人: layout_marginBottom =“20dp” – ngesh
在膨胀期间用父视图替换null。 –