0

広告を表示するのに十分なスペースがないという問題は理解していますが、修正方法がわかりません。何かがスペースを使いすぎているのではないかと推測していますが、それが何であるかは正確にはわかりません。私は具体的にはAmazonの広告ではなく、admobの広告について言及しています。

これはlogcatです:

08-13 19:09:42.972: ERROR/Ads(891): Not enough space to show ad! Wants: <480, 75>, Has: <432, 610>
08-13 19:09:42.972: ERROR/Ads(891): Not enough space to show ad! Wants: <480, 75>, Has: <432, 97>

これは私のxmlファイルです:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
xmlns:Amazon="http://schemas.android.com/apk/lib/com.amazon.device.ads"
android:layout_height="match_parent"
android:background="@drawable/background5"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:id="@+id/MainLayout"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
tools:context=".MainActivity">


//start button
<Button
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Start"
        android:background="#19d2b2"
        android:id="@+id/start_button"
        android:layout_above="@+id/instructions_button5"
        android:layout_centerHorizontal="true"/>

//Instructions button
<Button
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Instructions"
        android:background="#19d2b2"
        android:id="@+id/instructions_button6"

        android:layout_below="@+id/start_button"
        android:layout_alignLeft="@+id/start_button"
        android:layout_marginTop="10dp"/>

<Button
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Gallery"
        android:background="#19d2b2"
        android:id="@+id/save_button"
        android:layout_below="@+id/instructions_button6"
        android:layout_alignParentRight="true"
        android:layout_marginTop="10dp"/>

<Button
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Scores"
        android:id="@+id/Scores"
        android:background="#19d2b2"
        android:layout_below="@+id/save_button"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="10dp"/>

<com.amazon.device.ads.AdLayout
        android:id="@+id/adview"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        Amazon:adSize="320x75"
        android:layout_marginTop="400dp"/>

<com.google.ads.AdView android:id="@+id/adView"
                       android:layout_width="400dp"
                       android:layout_height="wrap_content"

                       ads:adUnitId="xxxxxxxxxxxxxxxx"
                       ads:adSize="BANNER"
                       android:layout_marginTop="300dp" android:layout_marginBottom="10dp"/>

4

2 に答える 2

1

囲んでいる RelativeLayout を次のように構成しました。

android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"

これにより、AdView で使用できる水平方向のスペースが減少します。これらを削除すると、動作するはずです。

于 2013-08-14T21:48:59.113 に答える
0

取り除くだけ

   android:paddingLeft="@dimen/activity_horizontal_margin"
   android:paddingRight="@dimen/activity_horizontal_margin"
   android:paddingTop="@dimen/activity_vertical_margin"
   android:paddingBottom="@dimen/activity_vertical_margin"

相対的なレイアウトから、あなたの問題は解決されました

于 2014-04-09T13:25:41.380 に答える