我有一个 Layout for Android 应用程序,里面有几个按钮。我正在尝试在页面底部设置广告。请参考我下面的布局:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/MainLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background_color"
android:gravity="center_horizontal"
android:orientation="vertical" >
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/adView"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_top_margin" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="@+id/textView0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left|center_vertical"
android:text=""
android:textColor="@color/text_color"
android:textSize="@dimen/nav_text_size" >
</TextView>
<Button
android:id="@+id/ProceedToScreen31"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableRight="@drawable/ic_action_name"
android:gravity="left|center_vertical"
android:text="@string/TA1"
android:textColor="@color/btn_text_color"
android:textSize="@dimen/button_text_size" >
</Button>
<Button
android:id="@+id/ProceedToScreen32"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableRight="@drawable/ic_action_name"
android:gravity="left|center_vertical"
android:text="@string/TA2"
android:textColor="@color/btn_text_color"
android:textSize="@dimen/button_text_size" >
</Button>
<Button
android:id="@+id/ProceedToScreen33"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableRight="@drawable/ic_action_name"
android:gravity="left|center_vertical"
android:text="@string/TA3"
android:textColor="@color/btn_text_color"
android:textSize="@dimen/button_text_size" >
</Button>
<Button
android:id="@+id/ProceedToScreen34"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableRight="@drawable/ic_action_name"
android:gravity="left|center_vertical"
android:text="@string/TA4"
android:textColor="@color/btn_text_color"
android:textSize="@dimen/button_text_size" >
</Button>
<View
android:layout_width="match_parent"
android:layout_height="2dip"
android:background="@color/line_color" >
</View>
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/copyright"
android:textColor="@color/text_color"
android:textSize="@dimen/small_text_size" >
</TextView>
</LinearLayout>
</ScrollView>
<com.google.ads.AdView
android:id="@+id/adView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
ads:adSize="BANNER"
ads:adUnitId="@string/MY_AD_UNIT_ID"
ads:loadAdOnCreate="true" />
</RelativeLayout>
广告完美地作为固定页脚进入页面底部(根据我的要求),但随着页面的其他组件也进入页面底部,页面顶部的空间很大。请帮助我如何对齐以便只有广告应该到达页面底部,其余所有组件都应该从页面顶部开始。