有好几种方式,我提供一种通过设置weight的方式吧。请看代码:
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
android:id="@+id/TextView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text="@string/hello" >
android:id="@+id/LinearLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="bottom"
android:layout_weight="8"
android:orientation="horizontal"
>
android:id="@+id/EditText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1" >
android:id="@+id/Button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="test"
android:gravity="center"
android:layout_weight="7" >