Q:

Ads Layout issue Android

I'm trying to add AdMob banner in one of my android applications.  I have tried many things but I am not able to show at the bottom of my layout.  I have attached the code from my Activity.  Please check and let me know what is wrong with it. 

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:ads="http://schemas.android.com/apk/res-auto"
    android:id="@+id/RelativeLayout1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/main_layout_background_color"
    android:orientation="vertical">

    <android.support.v7.widget. Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="?attr/colorPrimary"
        android:elevation="6dp"
        android:minHeight="?attr/actionBarSize">

    </android.support.v7.widget. Toolbar>


    <GridView
        android:id="@+id/lv_Levels"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="10dp"
        android:background="@android:color/transparent"
        android:horizontalSpacing="20dp"
        android:numColumns="3"
        android:stretchMode="columnWidth"
        android:verticalSpacing="20dp">

    </GridView>

    <LinearLayout
        android:id="@+id/ad"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/main_layout_background_color"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:gravity="center"
        android:orientation="horizontal">
        <com.google.android.gms.ads. AdView
            android:id="@+id/adView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom|center"
            ads:adSize="BANNER"
            ads:adUnitId="@string/banner_ad_unit_id">
        </com.google.android.gms.ads. AdView>

    </LinearLayout>

</LinearLayout>

I'm unable to keep it bottom.  its going out of screen and so its not showing.  

Thanks

A:

This will solve the issue:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:ads="http://schemas.android.com/apk/res-auto"
        android:id="@+id/RelativeLayout1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/main_layout_background_color">

        <android.support.v7.widget. Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="?attr/colorPrimary"
            android:elevation="6dp"
            android:minHeight="?attr/actionBarSize">

        </android.support.v7.widget. Toolbar>

        <GridView
            android:id="@+id/lv_Levels"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="10dp"
            android:background="@android:color/transparent"
            android:horizontalSpacing="20dp"
            android:layout_below:"@+id/toolbar"
            android:layout_above:"@+id/ad"
            android:numColumns="3"
            android:stretchMode="columnWidth"
            android:verticalSpacing="20dp">

        </GridView>

        <LinearLayout
            android:id="@+id/ad"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@color/main_layout_background_color"
            android:layout_alignParentBottom="true"
            android:gravity="center"
            android:orientation="horizontal">

            <com.google.android.gms.ads. AdView
                android:id="@+id/adView"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="bottom|center"
                ads:adSize="BANNER"
                ads:adUnitId="@string/banner_ad_unit_id">
            </com.google.android.gms.ads. AdView>

        </LinearLayout>

    </RelativeLayout>

