我正在嘗試在我的應用程序中顯示Google的橫幅廣告。我有這個佈局(activity_main):AdMob Banner:沒有足夠的空間來顯示廣告
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar"/>
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="@string/id">
</com.google.android.gms.ads.AdView>
</RelativeLayout>
</LinearLayout>
當我跑我的應用我在logcat中看到以下錯誤:
Not enough space to show ad. Needs 320x50 dp, but only has 360x0 dp.
如何解決它,並顯示橫幅廣告嗎?提前致謝。如果你想
還需要將AdView封裝在RelativeLayout中。 – Psypher