广告不会停留在底部

Kev*_*vin 0 android admob android-layout

我在底部有一个可滚动的文字和广告,但是广告并没有一直到底部。尝试过RelativeLayout,但如果我使用它,则广告会停留在屏幕中间。已经玩了很多,但是似乎无法让它停留在底部并在屏幕的其余部分填充可滚动文本。

<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@drawable/box_background"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:orientation="vertical">



   <ScrollView
       android:id="@+id/ScrollView01"  
       android:layout_height="wrap_content"
       android:layout_width="fill_parent"
       android:padding="30dp">

    <TextView
        android:id="@+id/Button_2_Text"
        android:textColor="#000000"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:textStyle="bold"
        android:textSize="17dp"></TextView>
        </ScrollView>

    <com.google.ads.AdView 
    android:gravity="bottom"
    xmlns:ads="http://schemas.android.com/apk/res/com.aurumlabs.excuses"
    android:id="@+id/adView" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    ads:adUnitId="a14f19b3aec0a93" 
    ads:adSize="BANNER"/>
    </LinearLayout>
Run Code Online (Sandbox Code Playgroud)

小智 5

如果你尝试使用RelativeLayout,但设置android:layout_above="@+id/adView"ScrollView,以及android:layout_alignParentBottom="true"AdView

有一个很好的博客帖子这个对谷歌广告开发者博客在这里