0
我想在TextView下方和Button上方添加相對佈局。我的按鈕位於LinearLayout中,而父項是RelativeLayout。如何在視圖下添加布局
這是我的代碼。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ImageView
android:id="@+id/iWantPageLogo"
android:layout_width="45dp"
android:layout_height="45dp"
android:src="@drawable/wic_logo_small" />
<Button
android:id="@+id/goButton_iWant"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="@string/go" />
<EditText
android:id="@+id/searchAutoCompleteTextView_iWant"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/goButton_iWant"
android:layout_toRightOf="@id/iWantPageLogo"
android:hint="@string/search" />
<TextView
android:id="@+id/iWantLabel"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/iWantPageLogo"
android:gravity="center_vertical|center_horizontal"
android:text="@string/iWant"
android:textColor="@color/white" />
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:="@+id/iWantLabel">
<TextView
android:id="@+id/iNeedToBuy"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/iWantPageLogo"
android:gravity="center_vertical|center_horizontal"
android:text="@string/iNeedToBuy"
android:textColor="@color/white" />
<EditText
android:id="@+id/iNeedToBuyEditText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/iNeedToBuy"
android:hint="@string/product"
android:textColor="@color/black" />
</RelativeLayout>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" >
<Button
android:id="@+id/feedButton_feed"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_margin="0dp"
android:layout_weight="1"
android:background="@color/white"
android:text="@string/feed"
android:textColor="@color/black" />
<Button
android:id="@+id/iWantButton_feed"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_margin="0dp"
android:layout_weight="1"
android:background="@color/white"
android:text="@string/iwant"
android:textColor="@color/black" />
<Button
android:id="@+id/shareButton_feed"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_margin="0dp"
android:layout_weight="1"
android:background="@color/white"
android:text="@string/share"
android:textColor="@color/black" />
<Button
android:id="@+id/profileButton_feed"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_margin="0dp"
android:layout_weight="1"
android:background="@color/white"
android:text="@string/profile"
android:textColor="@color/black" />
</LinearLayout>
</RelativeLayout>
我的相對佈局(其中包含的TextView和EditText上),這是在父佈局(RelativeLayout的)爲低於iWantLabel和線性佈局,其包含按鈕上方。如何實現這一點