0

On my app the main activity have a fragment (to show google maps), 4 buttons (over the maps) and a banner. In this moment the banner is over the map but I want see banner after fragment and not over.

This is my activity:

enter image description here

and this is what I want:

enter image description here

I don't understand how edit my xml file to have this result:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res-auto">
<!--suppress AndroidDomInspection -->

<fragment
    android:id="@+id/map"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:name="com.google.android.gms.maps.SupportMapFragment"
    android:layout_alignParentBottom="true"
    android:layout_alignParentTop="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentRight="true" />

<RelativeLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_alignParentTop="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentRight="true">

    <ImageButton
        android:id="@+id/buttonMapUser"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:layout_marginRight="160sp"
        android:layout_marginTop="10sp"
        android:padding="3dp"
        android:background="@drawable/mapbutton"
        android:src="@drawable/ic_map_user"/>

    <ImageButton
        android:id="@+id/buttonMapSelect"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:layout_marginRight="110sp"
        android:layout_marginTop="10sp"
        android:padding="3dp"
        android:background="@drawable/mapbutton_2state"
        android:src="@drawable/ic_map_select"/>

    <ImageButton
        android:id="@+id/buttonMapTriangles"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:layout_marginRight="60sp"
        android:layout_marginTop="10sp"
        android:padding="3dp"
        android:background="@drawable/mapbutton_2state"
        android:src="@drawable/ic_map_triangles"/>

    <ImageButton
        android:id="@+id/buttonMapList"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:layout_marginRight="10sp"
        android:layout_marginTop="10sp"
        android:padding="3dp"
        android:background="@drawable/mapbutton"
        android:src="@drawable/ic_map_list"/>
</RelativeLayout>

<com.google.android.gms.ads.AdView
    android:id="@+id/adView"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    ads:adUnitId="xxx"
    ads:adSize="BANNER"
    android:layout_gravity="bottom"/>

</RelativeLayout>
Martin
  • 1,065
  • 1
  • 17
  • 36

1 Answers1

0

Try it in your Banner:

ads:adSize="SMART_BANNER"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
android:layout_below="@+id/map"

And this in your fragment:

android:layout_alignParentTop="true"

Victor Gomes
  • 463
  • 6
  • 15