整天为此撕扯我的头发
我试图在屏幕底部有两个线性布局,每个都有几个底部。我想要一个线性布局在右边,一个在左边
到目前为止我有
<?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"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/home_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<!-- MAIN CONTENT WILL GO HERE -->
</LinearLayout>
<LinearLayout
android:id="@+id/ad_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/home_layout"
android:layout_alignParentBottom="true"
android:gravity="bottom" >
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="right"
android:background="@android:color/white"
android:gravity="right"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="£12.50" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Rate1 **** " />
</LinearLayout>
</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"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/home_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<!-- MAIN CONTENT WILL GO HERE -->
</LinearLayout>
<LinearLayout
android:id="@+id/ad_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/home_layout"
android:layout_alignParentBottom="true"
android:gravity="bottom" >
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="left"
android:background="@android:color/white"
android:gravity="left"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="£12.50" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Rate1 **** " />
</LinearLayout>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="right"
android:background="@android:color/white"
android:gravity="right"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="£12.50" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Rate1 **** " />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
产生:
任何的想法?