如何在导航抽屉活动中添加admob?

时间:2016-08-03 07:38:43

标签: android android-layout

我遇到错误在项目中添加admob,尝试在content_main.xml中添加admob ..修复我的问题如何在导航抽屉活动中添加admob

<?xml version="1.0" encoding="utf-8"?>
    <android.support.constraint.ConstraintLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:ads="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:id="@+id/content_main"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context="allstores.soft.prmk.allstores.MainActivity"
        tools:showIn="@layout/app_bar_main">

        <RelativeLayout
            android:id="@+id/relative_layout"
            android:layout_width="match_parent"
            android:layout_height="match_parent" >
        <WebView
            android:id="@+id/myWebView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_above="@+id/adView"/>

            <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:adSize="SMART_BANNER"
            ads:adUnitId="AD_UNIT_IT"
            android:gravity="bottom" />
        </RelativeLayout>

    </android.support.constraint.ConstraintLayout>

0 个答案:

没有答案