I have released an app, but the problem is with admob pushing the layout, say you start drawing a gesture as soon as you open the activity then after a couple of seconds a ad pops up, it pushes the content and as a result ruins the gesture you’ve drawn.
How can I stop this from happening, I want the ad to load but not push the what’s underneath it.
I have included the XML of my create gesture layout
<?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>
It’s pushing your view because you set the height to wrap_content. When the view first loads, there is no ad to display, so the height is zero. Try setting the height of the container view so the view always takes up the space you need for your ad: