-まず、 L1LinearLayout
という名前のMain Parent layout
仮定として、Vertical orientation.
-次に、レイアウトL1としてL2として2 番目LinearLayout
の名前を作成します。child to the parent
Vertical orientation
-button
この子に 2 を配置しますLinearLayout L2.
-という名前のこのLinearLayout
L2 属性を設定しますLayout_weight as 1.
-次に、RelativeLayout
この LinearLayout L2 の下に配置し、ここで動的に生成しtextView
ます....
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" android:layout_weight="1">
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
</LinearLayout>
<RelativeLayout
android:id="@+id/relativeLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" >
</RelativeLayout>
</LinearLayout>