我已經發布了一個應用程序,但問題在於admob推動佈局,比方說當您打開活動後開始繪製手勢,然後幾秒鐘後會彈出一個廣告,推動內容並因此破壞您繪製的手勢。Android - Admob推動佈局下降
我該如何阻止這種情況發生,我希望廣告加載但不推動它下面的內容。
我已經包括了我創建的姿態佈局
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/gridbg"
android:orientation="vertical">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<com.google.ads.AdView
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:id="@+id/adView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
ads:adUnitId=""
ads:adSize="BANNER"
ads:loadAdOnCreate="true"
android:gravity="center_horizontal"/>
</LinearLayout>
<android.gesture.GestureOverlayView
android:id="@+id/gestures_overlay"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1.0"
android:gestureColor="#00FFFF"
android:gestureStrokeType="multiple" />
<LinearLayout
style="@android:style/ButtonBar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:id="@+id/done"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:enabled="false"
android:onClick="addGesture"
android:text="@string/button_done"
style="@style/BlueButtonText"
android:background="@drawable/blue_button"
/>
<Button
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="cancelGesture"
android:text="@string/button_discard"
style="@style/BlueButtonText"
android:background="@drawable/blue_button"
/>
</LinearLayout>
</LinearLayout>
或者,他也可以完全擺脫LinearLayout,只需在com.google.ads.AdView中放置'layout_height =「50dp」'。 – 2012-08-07 21:22:33
@EricLeichtenschlag非常真實。我通常喜歡在我的廣告背後拍一個背景,這樣他們就更加美味了,所以我的包裝通常都是包裝好的。 – 2012-08-07 21:36:12
歡呼聲,工作很好在平板電腦和移動 – Reg 2012-08-08 20:14:47