Skip to content Skip to sidebar Skip to footer

Admob | Extend Banner Size?

My goal is to make admob banner stand at the bottom of the screen as in this photo: http://goo.gl/3POR1n But I do not know how to do banner sits hit the screen because of the highe

Solution 1:

Wrap your LinearLayout inside another RelativeLayout. That way the LinearLayout's padding won't reduce the available space for the banner.

See example:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:ads="http://schemas.android.com/apk/res-auto"
    android:id="@+id/mainLayout"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >   

    <LinearLayout  

    //copy paste your linear layout code here (without AdView).. 

    ...

    </LinearLayout>

    <com.google.android.gms.ads.AdView
        android:id="@+id/adView"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_alignParentBottom="true"
        ads:adSize="SMART_BANNER"
        ads:adUnitId="@string/adMob_ID" />

</RelativeLayout>

Note the android:layout_alignParentBottom="true" which aligns the AdView to the bottom

Post a Comment for "Admob | Extend Banner Size?"