Я хочу разместить свое объявление admob в нижней части родителя для всех действий. Но это показывает эту ошибку в некоторых случаях.Недостаточно места для отображения предупреждения Admob ad
W/Ads(13240): Not enough space to show ad! Wants: <240, 37>, Has: <240, 0>
Мой XML код:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical" >
<LinearLayout
style="@style/padding_title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/ic_title" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="Tickets & Cards"
android:textColor="@color/white"
android:textSize="18.0sp"
android:textStyle="bold" />
</LinearLayout>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<More items here>
</ScrollView>
<include layout="@layout/ad_container" />
</LinearLayout>
И ad_container.xml является:
<?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"
android:id="@+id/linear_layout_adv_container"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<com.google.ads.AdView
android:id="@+id/adView"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adSize="SMART_BANNER"
ads:adUnitId="a15xxxxxxa8088"
ads:loadAdOnCreate="true"
ads:testDevices="TEST_EMULATOR, TEST_DEVICE_ID" />
</RelativeLayout>
Я не знаю, что мне не хватает и почему он получает 0 высота вместо требуемого. Я надеюсь, что кто-то указывает на проблему. Спасибо
Так что я должен сделать, чтобы оно появилось внизу? – user818455
Установите его на 37 пикселей, insted of wrap_content. – g00dy