Admob Banner - Android

Asked

Viewed 91 times

0

I’m trying to put a banner on my app, actually I got it. But when I run the virtual machine, it sits underneath the buttons, the machine is a Nexus 5.

Banner

My activity_main code is this.

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:ads="http://schemas.android.com/apk/res-auto"
    android:id="@+id/activity_main_drawerLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:openDrawer="start">

    <FrameLayout
        android:id="@+id/activity_main_fragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="?attr/root_color" >

    </FrameLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:gravity="bottom"
        android:orientation="vertical" >

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

    </LinearLayout>


    <android.support.design.widget.NavigationView
        android:id="@+id/activity_main_navView"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:background="?attr/root_color"
        app:headerLayout="@layout/container_nav_header"
        app:itemIconTint="?attr/content_color"
        app:itemTextColor="?attr/content_color">

    </android.support.design.widget.NavigationView>


</android.support.v4.widget.DrawerLayout>
  • Define the windowTranslucentNavigation of your style.xml as false.

  • you put a admob on the side menu?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.