0

我在将 admob 放在屏幕底部时遇到了一些问题。出于某种奇怪的原因,广告只是悬停在底部上方。

我希望 Admob 位于屏幕底部,他将不胜感激任何帮助!

在此处输入图像描述

代码:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background_high"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".HodgeMain"
android:layout_above="@+id/ad" >

<ListView
    android:id="@+id/BoardList"
    android:layout_width="wrap_content"
    android:layout_height="270dp"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="93dp"
    android:listSelector="@drawable/listcolor" >
</ListView>




    <com.google.ads.AdView
        android:id="@+id/ad"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        ads:adSize="BANNER"
        ads:adUnitId="XXXXXXXXX"
        ads:loadAdOnCreate="true" >
    </com.google.ads.AdView>


</RelativeLayout>
4

3 回答 3

1

您的 Adview 正在从底部填充。因为您的 Adview 即 RelativeLayout 的容器有android:paddingBottom="@dimen/activity_vertical_margin"

于 2013-08-25T08:05:44.430 回答
1

尝试这个

<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background_high"
tools:context=".HodgeMain">

<ListView
    android:id="@+id/BoardList"
    android:layout_width="wrap_content"
    android:layout_height="270dp"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="93dp"
    android:listSelector="@drawable/listcolor" >
</ListView>

    <com.google.ads.AdView
        android:id="@+id/ad"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        ads:adSize="BANNER"
        ads:adUnitId="XXXXXXXXX"
        android:layout_centerHorizontal="true"
        ads:loadAdOnCreate="true" >
    </com.google.ads.AdView>

</RelativeLayout>

我只是删除了不必要的东西并将其置于底部和中心。

于 2013-08-25T08:07:36.110 回答
0

只需android:layout_above="@+id/ad"从移动RelativeLayoutListView

于 2013-08-25T07:51:32.670 回答