0
我想將我的admob廣告放在所有活動的父級底部,但在某些情況下顯示此錯誤。沒有足夠的空間顯示Admob廣告警告
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高度而不是必需的one.I希望有人指出這個問題。謝謝
那麼我該怎麼做才能讓它出現在底部? – user818455 2013-02-27 03:49:55
將其設置爲37像素,內容爲wrap_content。 – g00dy 2013-02-27 07:33:26